+ Reply to Thread
Results 1 to 4 of 4

Thread: Whats wrong with my query - Microsoft JET Database Engine (0x80040E14)

  1. #1
    Barn Frequenter PhloooooIsFlo is on a distinguished road PhloooooIsFlo's Avatar
    Join Date
    Jul 2008
    Location
    Jakarta, Indonesia, Indonesia
    Posts
    109
    Rep Power
    4

    Whats wrong with my query - Microsoft JET Database Engine (0x80040E14)

    Hei all, good day to you!!

    I need help to find out whats wrong with my query (I'm using ASP code and Access as the db)

    Here's the code :
    Code:
                    strOpen = request.Form("opencurtain")
    		strMaterial = request.Form("material")
    		strRailings = request.Form("railing")
    		strLining = request.Form("lining")
    		strFitrase = request.Form("fitrase")
    		strTassel = request.Form("tassel")
    		strTieBack = request.Form("tieback")
    		strWidth = request.Form("txtWidth")
    		strLength = request.Form("txtLength")
    		strQty = request.Form("txtQty")
    		
    		strSQL = "SELECT * FROM Material WHERE MaterialID=" & strMaterial
    		rs.open strSQL, db, 3, 3
    		
    		if not rs.eof then
    			strMaterialName = rs("MaterialName")
    		end if
    		rs.close
    		
    		strSQL = "SELECT * FROM Tassel WHERE TasselID=" & strTassel
    		rs.open strSQL, db, 3, 3
    		
    		if not rs.eof then
    			strTasselName = rs("TasselHook")
    		end if
    		rs.close
    
    		
    		strSQLCart = "INSERT INTO CurtainCart (CustomerCurtainCode, Open, Material, Railing, Lining, Fitrase, Tassel, TieBack, Width, Length, Qty) VALUES (" & AP(Request.Cookies("CustomerCode")) & ", " & AP(strOpen)  & ", " & AP(strMaterialName)  & ", " & AP(strRailings)  & ", " & AP(strLining)  & ", " & AP(strFitrase)  & ", " & AP(strTasselName)  & ", " & AP(strTieBack)  & ", " & AP(strWidth)  & ", " & AP(strLength)  & ", " & AP(strQty)  & ")"
    
    		If strSQLCart <> "" Then dbsc.Execute strSQLCart
    
    I've tried to show the SQL query using Response.Write and the result as below :

    INSERT INTO CurtainCart (CustomerCurtainCode, Open, Material, Railing, Lining, Fitrase, Tassel, TieBack, Width, Length, Qty) VALUES ('295835493', '2 Ways', 'KEV_0084', 'Wooden', 'With Lining Blackout', 'Without Fitrase', 'Slide 107', 'Without Tie Back', '2', '2', '2')

    And also I've tried to append the data manually using Query SQL in Access, and the data is successfully added into the table.
    PS : I set all type of data in the table above as a text

    I have no idea what did i miss there >.<

    Oh, and the error message is :

    Error Type:
    Microsoft JET Database Engine (0x80040E14)
    Syntax error in INSERT INTO statement.


    Does anyone could help?
    Thx

  2. #2
    Lazy Bum micky is a jewel in the rough micky is a jewel in the rough micky is a jewel in the rough micky is a jewel in the rough micky's Avatar
    Join Date
    Jul 2008
    Location
    India
    Posts
    1,763
    Blog Entries
    2
    Rep Power
    8

    may be u have reserved words as ur fields names, try wrapping them in square brackets like
    Code:
    strSQLCart = "INSERT INTO CurtainCart (CustomerCurtainCode, [Open], [Material], Railing, Lining, Fitrase, Tassel, TieBack, Width, [Length], Qty)
     VALUES (" & AP(Request.Cookies("CustomerCode")) & ", " & AP(strOpen)  & ", " & AP(strMaterialName)  & ", " & AP(strRailings)  & ", " & AP(strLining)  & ", " & AP(strFitrase)  & ", " & AP(strTasselName)  & ", " & AP(strTieBack)  & ", " & AP(strWidth)  & ", " & AP(strLength)  & ", " & AP(strQty)  & ")"
    
    edit: just noticed that u dont have single quotes around values in ur query, so how come they appear in the response.write??
    if u dont have them, u'll need them in the query.
    Last edited by micky; November 18th, 2008 at 03:14 AM.

  3. #3
    Barn Frequenter PhloooooIsFlo is on a distinguished road PhloooooIsFlo's Avatar
    Join Date
    Jul 2008
    Location
    Jakarta, Indonesia, Indonesia
    Posts
    109
    Rep Power
    4

    Sweet!!! Thx Micky

  4. #4
    Lazy Bum micky is a jewel in the rough micky is a jewel in the rough micky is a jewel in the rough micky is a jewel in the rough micky's Avatar
    Join Date
    Jul 2008
    Location
    India
    Posts
    1,763
    Blog Entries
    2
    Rep Power
    8

    anytime phloo

+ Reply to Thread

Similar Threads

  1. Replies: 0
    Last Post: August 15th, 2008, 06:36 PM
  2. Using Dropdown List Value in Database SQL Query
    By richyrich in forum ASP Code Samples
    Replies: 0
    Last Post: April 2nd, 2008, 11:05 AM
  3. Replies: 2
    Last Post: March 16th, 2008, 11:18 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

SEO by vBSEO