Re: Microsoft JET Database Engine error '80040e10'
- From: "Bob Barrows [MVP]" <reb01501@xxxxxxxxxxxxxxx>
- Date: Thu, 29 Nov 2007 17:19:50 -0500
TonnyD wrote:
This is what I have for the script right now. I wasent sure if I was
suppost to remove the "Set rspoll=" part or not.
You were.
<%
ID = Clng(Request.querystring("ID"))
strSQL = "SELECT * FROM tblIP WHERE IP = '" &
request.servervariables("remote_addr") & "' AND pollID=" & ID
SET rsPoll = adoCon.execute(strSQL)
IF rsPoll.EOF Then
rsPoll.close
strSQL="UPDATE tblCount SET " & Request.Form("txtOption") & "
= " & Request.Form("txtOption") & " + 1 WHERE ID = " & ID
SET rsPoll=adoCon.execute strSQL,,129
Response.Write strSQL
OK, I misspoke in my prior message. The Response.Write needs to be
_after the statement that defines the string to be stored in strSQL_,
but BEFORE the Execute statement (it's the Execute statement that is
raising the error). The goal is to write the statement to response
before attempting to execute it so you can troubleshoot it. of course,
once things are running smoothly, you will comment out those
response.writes.
Anyways, it needs to look like this:
strSQL="UPDATE tblCount SET " & _
Request.Form("txtOption") & "= " & _
Request.Form("txtOption") & " + 1 WHERE ID = " & ID
Response.Write strSQL
adoCon.execute strSQL,,129
strSQL="INSERT INTO tblIP (IP, pollID) VALUES('" &
Request.Servervariables("REMOTE_ADDR") & "','" & ID & "')"
Response.Write strSQL
adoCon.execute strSQL,,129
This was a ASP Poll script that was free. It has a faq teq page, but
it only has errors for the databse. Nothing that includes this.
I guess you get what you pay for. This script is poorly written and
insecure as well: the use of concatenation to form sql statements (aka
dynamic sql) is leaving your site vulnerable to hackers using a
technique called sql injection. When you're a little more comfortable
with writing and debugging code, come back and ask about it. I've got
some links that will prove enlightening to you.
Anyways, run the page, and then test each sql statement that was written
to the browser screen using the Access Query Builder.
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
.
- Follow-Ups:
- Re: Microsoft JET Database Engine error '80040e10'
- From: TonnyD
- Re: Microsoft JET Database Engine error '80040e10'
- References:
- Microsoft JET Database Engine error '80040e10'
- From: TonnyD
- RE: Microsoft JET Database Engine error '80040e10'
- From: Max
- Re: Microsoft JET Database Engine error '80040e10'
- From: TonnyD
- Re: Microsoft JET Database Engine error '80040e10'
- From: Bob Barrows [MVP]
- Re: Microsoft JET Database Engine error '80040e10'
- From: TonnyD
- Re: Microsoft JET Database Engine error '80040e10'
- From: Bob Barrows [MVP]
- Re: Microsoft JET Database Engine error '80040e10'
- From: TonnyD
- Re: Microsoft JET Database Engine error '80040e10'
- From: Bob Barrows [MVP]
- Re: Microsoft JET Database Engine error '80040e10'
- From: TonnyD
- Microsoft JET Database Engine error '80040e10'
- Prev by Date: Re: Microsoft JET Database Engine error '80040e10'
- Next by Date: Re: Microsoft JET Database Engine error '80040e10'
- Previous by thread: Re: Microsoft JET Database Engine error '80040e10'
- Next by thread: Re: Microsoft JET Database Engine error '80040e10'
- Index(es):
Relevant Pages
|