RE: ASP Problem
by Andrej Kostresevic <temporalassassin(at)yahoo.com>
|
Date: |
Fri, 11 May 2001 08:10:39 -0700 (PDT) |
To: |
"Wood, Danny" <dwood(at)chi.navtech.com>, "'Jason Berhalter'" <berh1571(at)fredonia.edu>, hwg-languages(at)hwg.org |
In-Reply-To: |
navtech |
|
todo: View
Thread,
Original
|
|
Nope, the single quote is fine.
It is part of SQL syntax.
This is what it will look like by the time it gets on the SQL side:
DELETE FROM tblGetProbInfo WHERE IP Address='addy'
--- "Wood, Danny" <dwood(at)chi.navtech.com> wrote:
> I'm no expert, but it looks like you have a stray single quote in the
> following line.
>
> strDelete = "DELETE FROM tblGetProbInfo WHERE IP Address='" &
>
> > -----Original Message-----
> > From: Jason Berhalter [mailto:berh1571(at)fredonia.edu]
> > Sent: Thursday, May 10, 2001 9:16 PM
> > To: hwg-languages(at)hwg.org
> > Subject: ASP Problem
> >
> >
> > Hello. I am writing a front end for a database and I am
> > trying to set up a
> > page that deletes records, here is my code:
> >
> > <%
> > dim objConn, objRec, strLook, sqlLook
> >
> > set objConn = server.CreateObject("ADODB.Connection")
> >
> > ' DSNless connection to Access Database
> > dim strConnect
> >
> > strConnect="DRIVER={Microsoft Access Driver (*.mdb)}; "
> > strConnect=strConnect & "DBQ=" &
> > server.mappath("/database/problems.mdb")
> >
> > 'objConn.Mode = adModeReadWrite '3
> > objConn.Open strConnect
> >
> > 'Check to delete
> >
> > if request("IP_Address") <> "" and request("Host_Name") <> "" and
> > request("Host_Name") <> "" then
> >
> > dim strDelete
> >
> > strDelete = "DELETE FROM tblGetProbInfo WHERE IP Address='" &
> > request("IP_Address") & "' AND Host Name='" &
> > request("Host_Name") & "' AND
> > BrowserOS='" & request("Browser_Info") & "' AND DateTime='" &
> > request("Date_Time") & "' AND Email='" &
> > request("email_address") & "' AND
> > URL='" & request("URL") & "' AND ProbDescription='" &
> > request("comments") &
> > "'"
> >
> > objConn.Execute strDelete
> >
> > response.write "<BR> The Entry Has Been Removed <BR>"
> >
> > end if
> > %>
> > --------------------------------------
> > I recieve the following error when I try to delete a record:
> >
> > Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
> >
> > [Microsoft][ODBC Microsoft Access Driver] Syntax error
> > (missing operator) in
> > query expression 'IP Address='.....
> >
> > /test.asp, line 28
> > -------------------------------------------
> >
> > Also, line 28 in my code is this: objConn.Execute strDelete
> >
> > Any ideas what could be wrong?
> >
> > -Jason Berhalter
> >
> >
> >
> >
__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/
HWG: hwg-languages mailing list archives,
maintained by Webmasters @ IWA