normanchiutan
Posts: 4
|
Posted: 06/22/2010, 11:04 PM |
|
Hi All,
I just wonder if anyone can help me on this issue. I have been searching for 4 days now and have not found the solution. Any help would be appreciated. I am new to this ASP and I am kind of lost right now. The page that is getting error is the "deleteItems.asp" and using MS Access database which is "siCart.mdb". I am using IIS 7 under Windows 7 Professional 64-bit. Now here is the error in the page:
------ Error Displayed as -----------------------------------------------------
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC Microsoft Access Driver] Syntax error in string in query expression 'Visitors='5'.
/myEnquiry/deleteItems.asp, line 14
----- "deleteItems.asp" Code -------------------------------------------------
1 <%
2 Dim strVisitorID, strVisitor
3
4 'strVisitor = session("visitorNameFromCookie")
5 'response.write strVisitor
6 strVisitorID = CInt(session("visitorID"))
7 response.write strVisitor
8
9 Set aConn = Server.CreateObject("ADODB.Connection")
10 Set aRt = Server.CreateObject("ADODB.Recordset")
11 'Set an active Connection and select fields from the database
12 aConn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("/") & "\..\db\siCart.mdb"
13 asql = "DELETE FROM itemEnquired WHERE Visitors='"& strVisitorID
14 aRt.Open asql, aConn
15
16 aConn.Close
17 Set aConn = Nothing
18
19 Response.Redirect "/products/detail.asp?id="&session("DetailID")
20 %>
----------------------------------------------------------------
The session "CInt(session("visitorID"))" is actually a number in the Access database. And I just could not solve it. Anyone with a good and kind heart to help me, would be highly appreciated.
Thank you very much for your time and have a pleasant day!
Cheers,
Norman
|
|
|
mljonzs
Posts: 124
|
Posted: 06/23/2010, 6:42 AM |
|
You are missing the closing ' around your value....
try this for line 13 above:
asql = "DELETE FROM itemEnquired WHERE Visitors='"& strVisitorID & "'"
_________________
What does not begin WITH God, will end in failure!
|
|
|
normanchiutan
Posts: 4
|
Posted: 06/27/2010, 11:04 PM |
|
Thanks for the reply. This has been resolved.
|
|
|
|