SSL v.3 Super Spy Lookup Version 3 |
NOC List Search Results<% 'Sample Database Connection Syntax for ASP and SQL Server. Dim oConn, oRs Dim qry, connectstr Dim db_name, db_username, db_userpassword Dim db_server Dim my_search id = Request("id") db_server = "LVA" db_name = "MyAppDB" db_username = "MyPublicUser" db_userpassword = "MyPassword!" fieldname = "ID" tablename = "noclist" connectstr = "Driver={SQL Server};SERVER=" & db_server & ";DATABASE=" & db_name & ";UID=" & db_username & ";PWD=" & db_userpassword Set oConn = Server.CreateObject("ADODB.Connection") oConn.Open connectstr 'standard search query qry = "SELECT * FROM " & tablename & " WHERE ID = " & Request("id") 'qry = "SELECT * FROM " & tablename Set oRS = oConn.Execute(qry) Do until oRs.EOF Response.Write "ID: " & oRs.Fields("id") & "" Response.Write "Title: " & oRs.Fields("spyname") & " " Response.Write "User: " & oRs.Fields("realname") & " " oRS.MoveNext Loop oRs.Close Set oRs = nothing Set oConn = nothing %> |