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

Database connection error: Server Undefined

Status
Not open for further replies.

prae

IS-IT--Management
Jun 7, 2001
2
US
I tried to access db in SQL server. But I received the error: Server Undefined.

Here is my code:
var Conn = Server.CreateObject("ADODB.Connection"); //The error is identified to be on this line

Conn.Open("DSN=Test;UID=TestID;PWD=TestPWD");
var testSQL = "Select * from departments";
var testRecordset;
testRecordset = Conn.Execute(testSQL);

testRecordset.Close();
testRecordset = null;
Conn.Close();
Conn = null;

I don't think my syntax is wrong. May be there are some things that I need to adjust in SQL entreprise. Any suggestions? Thanks so much!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top