Jump to content

Recommended Posts

Posted (edited)

suppose i have this:

Set cnBIL = New ADODB.Connection
With cnBIL
   .ConnectionTimeout = 500
   .ConnectionString="uid=SQL_BLA;pwd=SQL_BLO;server=SQLserv;driver={SQL Server};database=TEST;dsn='SQL_TEST';"
   .CursorLocation = adUseClient
   .Open
End With

the program would crash if the dsn SQL_TEST isn't set in the user or system datasources list (working under wnidows 2000 it can be found under Administrative tools". so what i want is a way to create the dsn from vb, so that i don't have to set it for each person who's gonna use the application.

i hope i made the problem clear.

thanks for the help

Edited by saprouzy

Posted (edited)

Rather than creating a dsn, try using a dsnless connection.

You pass all connection info as as string in your code.

To create your connections, create a text file and name myconn.udl. Then in properties set all of the correct parameters and save it, then open in text editor to get the connection string that you will use in your code.

google "ado dsnless connection" for more info.

you could also set the connection to use the .udl file itself and include it in your install.

Edited by dman
Posted (edited)

i made a module to create the dsn's

but ur idea of dsnless connections is interesting

i'll look into it,

does it affect speed in any way?

thanks

Edited by saprouzy

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...