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!

Connecting to SQL Server from Server side JavaScript

Status
Not open for further replies.

lakshman

IS-IT--Management
Feb 6, 2002
5
0
0
US
Hai,
How to access SQL Server from Serverside Javascript. Please give me detailed description of all thing and if possible supply code also.
by
Lakshman
 
heres an example with comments:

//get parameters
queryvar = Request.QueryString("someparam");

//make connection
aconn = Server.CreateObject('ADODB.connection');
aconn.Open("DSN=ACUSQL_SBC;UID=sbc;PWD=sbc;");

//define query and execute
sqlbeg = "SELECT * FROM sbc WHERE code='"+queryvar+"'";
recset = aconn.Execute(sqlbeg);

now your records are stored in recset and can be accessed like recset("fieldname") jared@aauser.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top