Alright guys, I'm having quite a time with this one. I'm getting an VB script error : Microsoft VBScript compilation error '800a0408'
Invalid character
/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 %>
<html>
<head>
<title>Form to database</title>
</head>
<body>
<%
'variables
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
MM_conn1_STRING="Provider=Microsoft.Generic.OLEDB.3.51;dsn=www.motorlists.com;uid=mechanic; pwd=k1n3t1c;Server.MapPath("motorlists.mdb");"
'ADO connection object
Set connection = Server.CreateObject("ADODB.Connection")
'Database connection open
connection.Open(MM_conn1_STRING)
'executed the SQL
connection.execute(sSQL)
response.write "The form information was inserted successfully."
'Done. Connection closed object ended
connection.Close
Set connection = Nothing
%>
</body>
</html>
any ideas?
stallwoes