Archive: SQL Statements


SQL Statements
Hey Guys,

I've found a way to set up a DSN to ODBC for SQL Server by modifying the windows registry. Now I'm curious if there is a way to use this DSN to send SQL statements to a database inside SQL Server.

My install program needs to set up a couple databases and tables within SQL Server. Any ideas out there?

Thanks,
-Justin


On this thread brainsucker mentions a more natural way to create a DSN. I am sure there is a function you can call to execute SQL queries. You can call this function the same way, using the System plug-in.


You could install SQL-DMO (SQL Data Management Objects) files, then use a script (.vbs or some such thing) using the SQL-DMO objects to either attach a database, or create it from scratch, or do whatever you need to do.

There are around 8 files or so, only one of which requires registering (but they are all needed). Look up Microsoft Knowledgebase article Q248241.