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!
Here is my code:
var Conn = Server.CreateObject("ADODB.Connection"
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!