Hi...I'm begging for help.
What I'm trying to do is create a website template that gets populated based on a unique parameter ID in the URL.
Using that value "1" that I get from the request.querystring I want to then be able to connect to a database and pull out specific data linked to that ID. I'm trying to do that but I can't seem to figure out what's wrong. I've created an aspfunc.asp page where the DB connection query is being written and referenced to in every page. My code on that page looks something like this...
<%
Dim objConn
Dim objRecordSet
Dim query
Dim ID
ID = request.queryString("ID")
Set objConn = Server.CreateObject("ADODB.Connection")
Set objRecordSet = Server.CreateObject("ADODB.Recordset")
query = "Select CustomerName from Customer"
query = query & "WHERE UnitID = ID"
objLFConn.Open "Provider=SQLOLEDB; Data Source = DATASERVER; Initial Catalog = DATABASE; User Id = user; Password= pwd"
objRecordSet.Open query, objConn
DO While Not objRecprdSet.EOF
LOOP
Set objConn = Nothing
Set objRecordSet = Nothing
query = ""
%>
What in the world am I missing?
Thanks
Matt
What I'm trying to do is create a website template that gets populated based on a unique parameter ID in the URL.
Using that value "1" that I get from the request.querystring I want to then be able to connect to a database and pull out specific data linked to that ID. I'm trying to do that but I can't seem to figure out what's wrong. I've created an aspfunc.asp page where the DB connection query is being written and referenced to in every page. My code on that page looks something like this...
<%
Dim objConn
Dim objRecordSet
Dim query
Dim ID
ID = request.queryString("ID")
Set objConn = Server.CreateObject("ADODB.Connection")
Set objRecordSet = Server.CreateObject("ADODB.Recordset")
query = "Select CustomerName from Customer"
query = query & "WHERE UnitID = ID"
objLFConn.Open "Provider=SQLOLEDB; Data Source = DATASERVER; Initial Catalog = DATABASE; User Id = user; Password= pwd"
objRecordSet.Open query, objConn
DO While Not objRecprdSet.EOF
LOOP
Set objConn = Nothing
Set objRecordSet = Nothing
query = ""
%>
What in the world am I missing?
Thanks
Matt