Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Oct 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

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

    i got the error below:

    Error Executing Database Query.
    [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>

  • #2
    New to the CF scene
    Join Date
    Nov 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    1. Is the file added as a System DSN in the ODBC control panel? (Start -> Control -> Admin -> ODBC -> System DSN). If not add it. name it feedback

    2. have you added the database into your data sources in the Coldfusion administration? If not you need to log in and add the file the same name as you did in the ODBC. Add it as a Microsoft Access database

    Also change your query to:
    Code:
    <CFQUERY DATASOURCE="feedback" NAME="Enquiry">
    
    INSERT INTO enquiry(fullname, telephone, email, Enquiry, comments)
    
    VALUES('#form.fullname#', '#form.telephone#', '#form.email#', '#form.Enquiry#', '#form.comments#')
    
    </CFQUERY>
    The Syntax is
    Insert into tablename Values
    Last edited by kjab; 11-06-2008 at 09:06 AM. Reason: misread original


  •  

    Posting Permissions

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