Auto ODBC declerations

mrond
12-16-2003, 07:02 AM
Hey guys
my situation is this:

I have a database on an MSSQL server.
I have about 200 computers that I have to go around and create ODBC connections to the database.

Each computer will use the exact same input details.

is there a way I can do this automatically and save myself a big headache?

00100b
12-16-2003, 07:06 AM
You could either distribute a File DSN or, you could use a DSN-Less ODBC Connection String in your application, or you could use the SQL Server OLE/DB Provider.

mrond
12-16-2003, 07:20 AM
You could either distribute a File DSN or, you could use a DSN-Less ODBC Connection String in your application, or you could use the SQL Server OLE/DB Provider.


Well, the applications that use the database are all hard coded with the Connection name in the ODBC. so I can't create a file DSN or use a dsn-less connection.

vbFace
12-16-2003, 09:58 AM
You can, as 00100b suggested, use the OLEDB Provider for MS SQL Server. It doesn't matter what DSN you have set up because OLEDB doesn't use it. Change and re-deploy the app. Its easier than going around to all 200 machines every time something changes :)

Better yet, create an .INI/.TXT file on a server and have the app read the ServerName (or IP) and DB Name from there when you connect. Never hard code any connection information.

Better yet yet, create a login form that reads the default connection info as stated above, so then you as the dev can point to a test machine/DB or you can easily have users change the DB to log into.

hux
12-16-2003, 10:09 AM
>>you could use the SQL Server OLE/DB Provider.

could you go into a bit more detail on this? Could one connect to Oracle using this technique?

00100b
12-16-2003, 10:17 AM
There is an Oracle provider for OLE/DB.

This thread (http://www.visualbasicforum.com/showthread.php?threadid=39722) contains links to some good information pertaining to the use of ADO.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum