Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Have DSN but now what?

Status
Not open for further replies.

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.
 
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top