PDA

Click to See Complete Forum and Search --> : This is probably simple (SQL)


joey o.
Oct 9th, 2000, 10:40 AM
I'm not familiar with how to do this in ASP. Can any one help. ASP tells me there should be a closing parenthesis at "ID" (ISSUENUM1 is a column in the table):
<%
Dim Connect, Query, var
Set Connect = Server.CreateObject("ADODB.Connection")
Connect.Open "NewSite"
Set Query = Connect.Execute ("Select * from Tracking where "ID" = Query("ISSUENUM1"))
do until Query.EOF
stuff
loop
%>

noone
Oct 9th, 2000, 11:09 AM
I think your problems comes from trying to use quoatation marks inside a string literal. Replace them with the ' character.

joey o.
Oct 9th, 2000, 07:03 PM
Hey thanks for the help!
Thanks to you guys and Dave in work, this code works:

' ISSUENUM1 is the value I'm passing from other form
' NewSite is the DSN
' Tracking is the Database Table
' ID is the field
<%
Dim Connect,Crit, Query, var
Crit = Request.Form("ISSUENUM1")
Set Connect = Server.CreateObject("ADODB.Connection")
Connect.Open "NewSite"
SQLstr = "Select * from Tracking where ID= '" & Crit & "'"
Set Query = Connect.Execute (SQLstr)
do until Query.EOF
'stuff
loop
%>