Jun 7, 2004 #1 kramers Programmer May 10, 2004 26 US I have a DSN defined on my webserver, but now what? How do I connect to it? If it's important I'm connecting to a sybase database.
I have a DSN defined on my webserver, but now what? How do I connect to it? If it's important I'm connecting to a sybase database.
Jun 7, 2004 #2 ralphtrent Programmer Jun 2, 2003 958 US here is an example of how to use ADO to connect to a sybase server using a dsn, replace [] and contents with your actuall info: dim objConn set objConn = server.createobject("ADODB.Connection") objConn.open("dsn=[dsn];uid=[username];pwd=[password];database=[databaseName]") 'to execute a call against the database do this set results = objConn.execute("select [columns] from ") 'now loop through the results do until results.eof [do what you want] results.movenext() loop 'close the database connection objConn.close 'destroy the database objects set objConn = nothing Upvote 0 Downvote
here is an example of how to use ADO to connect to a sybase server using a dsn, replace [] and contents with your actuall info: dim objConn set objConn = server.createobject("ADODB.Connection") objConn.open("dsn=[dsn];uid=[username];pwd=[password];database=[databaseName]") 'to execute a call against the database do this set results = objConn.execute("select [columns] from ") 'now loop through the results do until results.eof [do what you want] results.movenext() loop 'close the database connection objConn.close 'destroy the database objects set objConn = nothing