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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBScript SQL 2000 Server Connection

Status
Not open for further replies.

DANZIG

Technical User
Mar 8, 2001
142
0
0
US
Hellos,
I'm looking for an example code for a VBScript connection to a remote SQL 2000 server. I'm trying to avoid the system or file DSN requirement on the system running the script so I can move the script from one system to another wiht having to build a new DSN on each system. I do need to use SQL authentication in the connection. The idea is to use SQL as my data storage media for administration scripts instead of excel.

Any examples would be greatly appreciated.

Thanks in advance.
 
[...]
set cnn = server.createobject("adodb.connection")
set rst = server.createobject("adodb.recordset")

cnn.open "server", "username", "password"
rst.open strQuery, cnn
[...]
 
Set Conn=CreateObject("ADODB.Connection")
Conn.Open "driver=SQL Server;server=YourServer;uid=YourId;pwd=YourPassword;database=YourDatabaseName;"
This is a DSN-less connection.

Hope This Help
PH.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top