SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Member
    Join Date
    Apr 2003
    Location
    malaysia
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Angry Syntax error in INSERT INTO statement???

    Syntax error in INSERT INTO statement.

    Please download the attachment and unzip it.

    I have 4 files:
    Starting with "signup.asp" - fill up the registration form. this will forward you to next form.
    "signup_process.asp" - process the filled form
    "signup_success.asp" - indicate that register successfully
    "Database.mdb" - the database file (MS Access 2000 format)

    My problem occurs in "signup_process.asp".
    The error message found in IE:

    Error Type:
    Microsoft JET Database Engine (0x80040E14)
    Syntax error in INSERT INTO statement.
    /myweb/signup_process.asp, line 31

    I look through my code, but found no mistake.

    But why still I cannot add the information in the form into the "Database.mdb"?

    Please guide me. Thank you.
    Attached Files Attached Files

  2. #2
    Bangarang! Karloff's Avatar
    Join Date
    Mar 2003
    Location
    Manchester, United Kingdom
    Posts
    236
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Mmh... can you please post line 31 of signup_process.asp where the error occurs?
    Karl


    I'm desperately trying to figure out why Kamikaze pilots wore helmets. - George Carlin

  3. #3
    SitePoint Member
    Join Date
    Apr 2003
    Location
    malaysia
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    dbQuery = "INSERT INTO Member (" & _
    "username, password, secretQuestion, secretAnswer, " & _
    "firstName, lastName, gender, " & _
    "street, city, state, country, zip, email, " & _
    "DOBMonth, DOBDay, DOBYear, occupation" & _
    ") VALUES (" & _
    "'" & Request("username") & "' , " & _
    "'" & Request("password") & "' , " & _
    "'" & Request("secretQuestion") & "' , " & _
    "'" & Request("secretAnswer") & "' , " & _
    "'" & Request("firstName") & "' , " & _
    "'" & Request("lastName") & "' , " & _
    "'" & Request("gender") & "' , " & _
    "'" & Request("street") & "' , " & _
    "'" & Request("city") & "' , " & _
    "'" & Request("state") & "' , " & _
    "'" & Request("country") & "' , " & _
    "'" & Request("zip") & "' , " & _
    "'" & Request("email") & "' , " & _
    "'" & Request("DOBMonth") & "' , " & _
    "'" & Request("DOBDay") & "' , " & _
    "'" & Request("DOBYear") & "' , " & _
    "'" & Request("occupation") & "'" & _
    ")"

    I suggest you download the attachment on my 1st post n run the asp pages n u'll notice the error in details! ok?

    Please help me. thank you.

  4. #4
    Just Blow It bronze trophy
    DaveMaxwell's Avatar
    Join Date
    Nov 1999
    Location
    Mechanicsburg, PA
    Posts
    7,294
    Mentioned
    123 Post(s)
    Tagged
    1 Thread(s)
    password is typically a reserved word in SQL. Try surrounding it in brackets [] or else renaming the table field and see if that helps.

    Otherwise, check all your datatypes and make sure they are correct. have all your datafields been checked for SQL validity (no O'Reillys which will cause problems with the ' if not handled)
    Dave Maxwell - Manage Your Site Team Leader
    My favorite YouTube Video! | Star Wars, Dr Suess Style
    Learn how to be ready for The Forums' Move to Discourse

  5. #5
    SitePoint Member
    Join Date
    Apr 2003
    Location
    malaysia
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No wonder. After I change to a different name, the error resolved. It took me 1 day to trigger this problem.
    Thanks a lot for helping me!

  6. #6
    SitePoint Enthusiast
    Join Date
    Apr 2003
    Location
    .vu
    Posts
    50
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    try putting intNumber and strName etc for everything and it can never happen again


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
  •