|
 |
access_asp thread: Query DB on URL Variable
Message #1 by "Todd Schumacher" <todds@w...> on Thu, 2 May 2002 19:40:58
|
|
How do I query a DB on a URL variable?
I am passing a variable to a page, news.asp?newsid=3
Then, I want to query a DB. Here's what I have:
<%
Set MyConn=Server.CreateObject("ADODB.Connection")
MyConn.Open "DSN=news"
MySQL="Select * from news where newsid = "
Set MyRs=MyConn.Execute(MySQL)
%>
I need to know what to put after "where news id
I'm a Coldfusion guy just now being thrown into ASP. Thanks for your help.
Message #2 by "Ethan Selzer" <ethanselzer@a...> on Thu, 2 May 2002 15:03:32 -0700
|
|
Hi Todd,
ASP has a set of intrinsic objects that you can look up in the iis help
files. To access the querystring (URL Variable) use the Request object like
this.
Request.Querystring("id")
Where id is the name of your variable.
Ethan
-----Original Message-----
From: Todd Schumacher [mailto:todds@w...]
Sent: Thursday, May 02, 2002 7:41 PM
To: Access ASP
Subject: [access_asp] Query DB on URL Variable
How do I query a DB on a URL variable?
I am passing a variable to a page, news.asp?newsid=3
Then, I want to query a DB. Here's what I have:
<%
Set MyConn=Server.CreateObject("ADODB.Connection")
MyConn.Open "DSN=news"
MySQL="Select * from news where newsid = "
Set MyRs=MyConn.Execute(MySQL)
%>
I need to know what to put after "where news id
I'm a Coldfusion guy just now being thrown into ASP. Thanks for your help.
|
|
 |