Depending on your network setup, you may want to use a DSN. Setting one up on your web server to access the database can be done through your control panel --> administrative --> ODBC data sources --> Follow the wizards to set one up. You can then use it like this:
dim strCon
strCon = "DSN=dsnName;UID=userName;PWD=password"
dim con
set con = server.createObject ("ADODB.Connection"
con.open strCon
I found that in a network setup where your DNS server isn't physically located in the general proximity of your web/data server, and your web and data server are separate, AND your web and data server are on the same subnet (i.e. you can name your data server rather than providing an IP address), a DSN using your data server's name is MUCH faster than using a DSN-less connection. There is also the fact that using a DSN makes your applications more portable since you only have to change the DSN in order to point all your applications to another database.
At any rate, if you want to use a DSN-less connection, just replace the strCon = "..." with this:
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.