i am trying to insert the form fields into the microsoft access database and also to

Discussion in 'Programming' started by Tochie, Oct 31, 2008.

  1. #1
    i am getting this error message:

    [Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement.


    i am using a coldfusion web page to connect to my data base. i am using microsoft access and i named it feedback. i created a table which i named enquiry. i am trying to insert the form fields into the microsoft access database and also to send a mail from the database to my mail.

    please what scripts can i use for this.

    i tried used the field shown below but it gave me an error message which says the datasource feedback cannot be foud. why is this so?

    Below is the scripts i used.

    <CFQUERY DATASOURCE="feedback" NAME="Enquiry">

    INSERT INTO feedback(fullname, telephone, email, Enquiry, comments)

    VALUES('#form.fullname#', '#form.telephone#', '#form.email#', '#form.Enquiry#', '#form.comments#')

    </CFQUERY>
    <CFMAIL TO="mymail@domain.com" FROM="#email#" subject="Enquiry">

    #fullname#

    #telephone#

    #email#

    #Enquiry#

    #comments#



    </CFMAIL>
     
    Tochie, Oct 31, 2008 IP
  2. KrishManohar

    KrishManohar Well-Known Member

    Messages:
    247
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    108
    #2
    I think your database or access needs to be added to your Cold Fusion Administrator.

    Then you can access it using data source.
     
    KrishManohar, Oct 31, 2008 IP
  3. cfStarlight

    cfStarlight Peon

    Messages:
    398
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #3
    If that is the entire error message, it might be a problem with reserved words. It might be "Email". Try escaping that column name with []. If that works, you should change the column. Otherwise you will have to use [] every time you use that column in a sql query

    INSERT INTO feedback(fullname, telephone,
     
    cfStarlight, Oct 31, 2008 IP
  4. robhustle

    robhustle Peon

    Messages:
    98
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Also, you might look up the CFQUERYPARAM tag
     
    robhustle, Oct 31, 2008 IP