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
    Regular Coder
    Join Date
    Nov 2005
    Posts
    750
    Thanks
    138
    Thanked 1 Time in 1 Post

    Not entering information into MS Access

    Hello

    I have the following ASP script which gets form field data from a Flash site (where the variables have been named as follows: name,email,business,country,message.

    However, when I complete the online form myself, no data is entered into my MS Access database. The path to the database is correct.

    When I look at my .asp file on the server I get the following error message:

    Microsoft VBScript runtime error '800a01f4'

    Variable is undefined: 'SQL'

    /ASPflash/flashEmailTest.asp, line 22

    These error messages (I previously got error messages saying conn, rs, etc were not defined, so I have defined them) seem to hide something deeper.

    Can I ask what is likely to be the problem here?

    The code is below.

    Many thanks for any help.

    Steve


    <%
    Dim conn,rs,name,email,business,country,message

    name = Request.Form("name")
    email = Request.Form("email")
    business = Request.Form("business")
    country = Request.Form("country")
    message = Request.Form("message")

    'Open MS Access database, store form field values, and close

    set conn=Server.CreateObject("ADODB.Connection")

    conn.Open "driver={Microsoft Access Driver (*.mdb)};DBQ=D:\Flashform.mdb;"
    set rs = Server.CreateObject("ADODB.recordset")

    SQL="INSERT INTO users (name, email, business, country, message) VALUES ('" & _
    name & "', '" & email & "','" & business & "', '" & country & "', '" & message & "')"

    rs.Open SQL, conn

    Set rs=Nothing

    conn.Close
    Set conn=Nothing
    %>

  • #2
    New Coder
    Join Date
    Dec 2007
    Location
    UK
    Posts
    41
    Thanks
    1
    Thanked 7 Times in 7 Posts
    You need to Dim SQL


  •  

    Posting Permissions

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