Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default Error with Records

    Hey Aaron,

    Your reply says "message unavailable"
    I am getting this error:

    Microsoft OLE DB Provider for ODBC Drivers
    error '80040e14'

    [Microsoft][ODBC Microsoft Access Driver] Syntax error in
    INSERT INTO statement

    My code is as follows: What's wrong?

    <%@ Language = VBscript%>

    <%
    'declare variables

    Dim FirstName
    Dim LastName
    Dim Building
    Dim RoomNumber
    Dim Telephone
    Dim Email
    Dim Problem
    Dim SQLINSERT
    Dim connRepairs
    Dim URL

    ' take variables from querystring

    FirstName = Request.querystring("FirstName")
    LastName = Request.querystring("LastName")
    Building = Request.queryString("Building")
    RoomNumber = Request.querystring("RoomNumber")
    Telephone = Request.querystring("Telephone")
    Email = Request.querystring("Email")
    Problem = Request.querystring("Problem")

    'Create Insert statement for new client

    SQLINSERT = "INSERT INTO REPAIRS (FirstName, LastName,
    Building, RoomNumber, Telephone, Email, Problem)"
    SQLINSERT = SQLINSERT & "VALUES ("
    SQLINSERT = SQLINSERT & "'" & FirstName & "',"
    SQLINSERT = SQLINSERT & "'" & LastName & "',"
    SQLINSERT = SQLINSERT & "'" & Building & "',"
    SQLINSERT = SQLINSERT & "'" & RoomNumber & "',"
    SQLINSERT = SQLINSERT & Telephone & ","
    SQLINSERT = SQLINSERT & "'" & Email & "',"
    SQLINSERT = SQLINSERT & "'" & Problem & "')"

    set connRepairs = server.createobject ("ADODB.Connection")
    connRepairs.open"Repairs"
    connRepairs.execute(SQLINSERT)
    connRepairs.close
    %>

    Vincent Guest

  2. Similar Questions and Discussions

    1. Error inserting records
      I am getting this error: Microsoft OLE DB Provider for ODBC Drivers error '80040e14' Syntax error in INSERT INTO statement My code is as...
    2. no records
      Hi, I am writing a jsp page to get data from db. <%@ Language=VBScript %> <!-- #include file="ConnString.asp" --> <html> <head> </head>...
    3. error when submit new DATE records
      I have to insert new records by a add_form.asp. the database is access. When I submit a record, if the DATE textbox is empty, I have an error...
    4. DNS SRV Records?
      Hi, how can I query DNS SRV records with ruby? regards Hadmut -- Hadmut Danisch http://www.danisch.de
    5. Urgent! Receiving error and duplicating records
      Please bear in mind I have only been using Access since December/January, and have learned how to do what I've done in this short time by trial and...
  3. #2

    Default Re: Error with Records

    "Vincent" <anonymous@discussions.microsoft.com> wrote in message
    news:1353601c3f7ff$863c8460$a101280a@phx.gbl...
    > Hey Aaron,
    >
    > Your reply says "message unavailable"
    > I am getting this error:
    >
    > Microsoft OLE DB Provider for ODBC Drivers
    > error '80040e14'
    >
    > [Microsoft][ODBC Microsoft Access Driver] Syntax error in
    > INSERT INTO statement
    >
    > My code is as follows: What's wrong?
    >
    > <%@ Language = VBscript%>
    >
    > <%
    > 'declare variables
    >
    > Dim FirstName
    > Dim LastName
    > Dim Building
    > Dim RoomNumber
    > Dim Telephone
    > Dim Email
    > Dim Problem
    > Dim SQLINSERT
    > Dim connRepairs
    > Dim URL
    >
    > ' take variables from querystring
    >
    > FirstName = Request.querystring("FirstName")
    > LastName = Request.querystring("LastName")
    > Building = Request.queryString("Building")
    > RoomNumber = Request.querystring("RoomNumber")
    > Telephone = Request.querystring("Telephone")
    > Email = Request.querystring("Email")
    > Problem = Request.querystring("Problem")
    >
    > 'Create Insert statement for new client
    >
    > SQLINSERT = "INSERT INTO REPAIRS (FirstName, LastName,
    > Building, RoomNumber, Telephone, Email, Problem)"
    > SQLINSERT = SQLINSERT & "VALUES ("
    > SQLINSERT = SQLINSERT & "'" & FirstName & "',"
    > SQLINSERT = SQLINSERT & "'" & LastName & "',"
    > SQLINSERT = SQLINSERT & "'" & Building & "',"
    > SQLINSERT = SQLINSERT & "'" & RoomNumber & "',"
    > SQLINSERT = SQLINSERT & Telephone & ","
    > SQLINSERT = SQLINSERT & "'" & Email & "',"
    > SQLINSERT = SQLINSERT & "'" & Problem & "')"
    >
    > set connRepairs = server.createobject ("ADODB.Connection")
    > connRepairs.open"Repairs"
    > connRepairs.execute(SQLINSERT)
    > connRepairs.close
    > %>
    >
    Is Roomnumber as char type?
    Is Telephone a numeric, otherwise it should also be in ''

    Response.write the sqlinsert, copy it into Access and run it, it will show
    you the part of the sql statement that is in error.


    --
    John Blessing

    [url]http://www.LbeHelpdesk.com[/url] - Help Desk software priced to suit all
    businesses
    [url]http://www.free-helpdesk.com[/url] - Completely free help desk software !
    [url]http://www.lbetoolbox.com[/url] - Remove Duplicates from MS Outlook


    John Blessing Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139