View Full Version : Not entering information into MS Access

01-04-2008, 03:05 PM

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.


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

Set conn=Nothing

01-04-2008, 03:08 PM
You need to Dim SQL