#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    2
    Rep Power
    0

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


    I've been using this page for a while now and suddenly it's stoped working and has given me an ODBC error. i've looked at the code and i'm a tad lost as to what has gone wrong. i've put a "repsonse.write(sql)" so i caa see the values see below:

    INSERT INTO pleq_item (category,date_added,added_by,date_modified,modified_by,finalised,`Name`,`Brand`,`Type`,`Physical Location`,`Supplier`,`Date purchased`,`Serial Number`,`Purchase Price`,`Out of Service`,`Model`,`Notes`,`Colour`,entity) VALUES (35,'2013-04-18',488,'2013-04-18',488,0,'','','',,'',NULL,'',, ,0,'','',,1)

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

    [MySQL][ODBC 3.51 Driver][mysqld-5.1.33-community]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''',NULL,'',, ,0,'','',,1)' at line 1

    /ajax/pleq/register/add_new_item.asp, line 62



    My SQL statement is as follows:

    sql = "SELECT pleq_fields.*, pleq_cat_fields.description FROM pleq_fields INNER JOIN pleq_cat_fields ON pleq_fields.id = pleq_cat_fields.field WHERE pleq_cat_fields.category=" & category & " ORDER BY pleq_cat_fields.order, pleq_fields.name"



    Please help me. Thanks.

    Regards - Jake
  2. #2
  3. SQL Consultant
    Devshed Supreme Being (6500+ posts)

    Join Date
    Feb 2003
    Location
    Toronto Canada
    Posts
    27,120
    Rep Power
    4274
    the INSERT statement is failing because you have two consecutive commas -- exactly where the error message says

    the SELECT statement did not generate the error message

    also, i've moved your thread to the mysql forum, because that's the database that issued the error
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    2
    Rep Power
    0
    Thanks for the replay and moving the topic, i did notice the two consecutive commas, but i can't seam to find them in the code..
  6. #4
  7. SQL Consultant
    Devshed Supreme Being (6500+ posts)

    Join Date
    Feb 2003
    Location
    Toronto Canada
    Posts
    27,120
    Rep Power
    4274
    Originally Posted by Jreid709
    ...i can't seam to find them in the code..
    well, no

    in your code i'm sure there's a php variable between them -- which is not getting initialized with a value
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

IMN logo majestic logo threadwatch logo seochat tools logo