Re: Microsoft JET Database Engine error '80040e10'



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.


.



Relevant Pages

  • Re: Job Priority, QZDASOINIT
    ... STRSQL? ... Have you tried a STRDBMON to see where the 2 minutes is spent? ... This is one of the SQL statements I'm trying to run. ... > SQL Server with Access as our reporting tool. ...
    (comp.sys.ibm.as400.misc)
  • Re: How to create an append query that appends to more than one ta
    ... You could write some VBA code that executes a series of SQL statements. ... Dim strSql As String ... Is there anyway to combine multiple append querries in one ...
    (microsoft.public.access.queries)
  • Re: 2 sql command
    ... You will have to write the SQL statements. ... Dim strSql As String ... ClientID - primary key ... how do i code it that all data of tblAnswer is linked to tblclient through ...
    (microsoft.public.access.queries)
  • Re: Cannot figure out error in asp code
    ... The easiest way to depug your SQL statements in asp is ... response.write strSQL ... - it plugs in all your variables in and you can check ...
    (microsoft.public.inetserver.asp.general)