Alright guys, I'm having quite a time with this one. I'm getting an VB script error : Microsoft VBScript compilation error '800a0408'
/addcust2database.asp, line 25
MM_conn1_STRING="Provider=Microsoft.Generic.OLEDB.3.51;" & _ "dsn=www.motorlists.com;" &_ "uid=mechanic; pwd=k1n3t1c;" &_ "Server.MapPath("motorlists.mdb");"
I'll print the code, but it's pretty long. The purpose is to send a form to database. I was able to rid it once by removing the quotations from motorlists.mdb but then it wouldn't run at all. well here you go:
<%@ Language="VBScript" %>
<% Option Explicit %>
<title>Form to database</title>
Dim fname, lname, Email, CEmail, Address, City, State
Dim MM_conn1_STRING, connection, sSQL
'values from Form, values entered to variables
fname = Request.Form("fname")
lname = Request.Form("lname")
Email = Request.Form("Email")
CEmail = Request.Form("CEmail")
Address = Request.Form("Address")
City = Request.Form("City")
State = Request.Form("State")
'SQL statements and Query
sSQL = "INSERT INTO motorlists.tblcustomer VALUES ('fname', 'lname', 'Email', 'Address','City','State')"
'connection string, and database
'driver and the location of database
'ADO connection object
Set connection = Server.CreateObject("ADODB.Connection")
'Database connection open
'executed the SQL
response.write "The form information was inserted successfully."
'Done. Connection closed object ended
Set connection = Nothing