I don't know what is wrong with this?

  • 18 years ago

    I have made a Response.Write of the SQL statement

    INSERT INTO movies_movies (title,author,date,comments,width,height) VALUES ('My Cool Movie','2','5/02/2003','My Cool Movie rocks It is cool','550','400')

    I don't know what is wrong with with this simple sql statement.

    Thanks for all your help

  • 18 years ago

    this is the error that iis displays

    Error Type:
    Microsoft JET Database Engine (0x80040E14)
    Syntax error in INSERT INTO statement.
    /stickkiller/movieupload.asp, line 15


  • 18 years ago

    Are the width and height fields defined in the db as integer values, just your sql statement has placed them in quote marks, implying you are trying to insert a string into these fields?

    See if that helps


  • 18 years ago

    Yes height and width are integers and also author
    I have changed all 3 and i still get the same error

    is there something with the date field i should know?

    thanks for your time

  • 18 years ago

    here are the fields

    id    AutoNumber
    title    Text
    author    Number
    date    Date/Time
    comments    Memo
    width    Number
    height    Number
    views    Number

  • 18 years ago

    I'm bit unsure about this but with dates I think you can enter them as

    5/02/2003# rather than quote marks. Having said that, I've used quote marks to enter dates to a date field in a VB application with no problems.

    Mmmm. Have you tried copying and pasting the sql statement directly into the SQL console of Access (I assume that's what you're using). Sometimes I do this as it gives more meanful syntax error reports.

  • 18 years ago

    could u tell me where the sql console is so i can put it in there


  • 18 years ago

    maybe it doesn't like the field named "date", as its a reserved keyword?

  • 18 years ago

    no it doesn't matter because i have 'date' in a table in another access db


  • 18 years ago

    Access SQl console

    Open Access db, select Queries, then double click create query in design view.
    A window will appear labelled Show Table. Close this...Select View|SQL view and a window will appear where you can paste in your SQL statement

  • 18 years ago

    I think you must enclose the word Date in braces:

    INSERT INTO movies_movies (title,author,[date],comments,width,height) VALUES ('My Cool Movie',2,#5/02/2003#,'My Cool Movie rocks It is cool',550,400)

  • 18 years ago

    thanks webjose that was the reason, if i changed the 'date' field to something like 'inserteddate' then would i need the square brackets/braces?

    Thanks to everyone who has helped in this topic all you work/help has been greatly appricated

    Thanks to zingmatter, James Crowley and webjose.

Post a reply

Enter your message below

Sign in or Join us (it's free).


Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“An idiot with a computer is a faster, better idiot” - Rich Julius