J
Jim
I'm still trying to get data to write to an access database. I've gove over
many examples of code but all the examples I've gone over and been directed
to have not given me strait answers.
I have an access called test.mdb located within the c:\inetpub\wwwroot\
folder where my other .htm and .asp docs are going. The database has a
single table called names. The fields within names are: fName, lName, and
zip
The code for dbtest.asp:
<html>
<head>
<title>dbsumbit</title>
</head>
<body>
<%
Dim cst,Conn,fName,lName,Zip
fName = Request.Form("firstname")
lName = Request.Form("lastname")
Zip = Request.Form("zipcode")
cst = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
Server.MapPath("/c:\inetpub\wwwroot\test.mdb")
set conn = CreateObject("ADODB.Connection")
conn.open cst
Conn.execute("INSERT INTO names VALUES fName='" & fName & "','" & lName &
"','" & Zip & "'")
%>
</body>
</html>
The above code is just one of my many attempts at making this thing work.
I've tried many different coding examples and methods and none of them have
worked. Of course, I don't know what I'm doing so that's why I'm here.
The code for my form (form.htm) that directs to dbtest.mdb after the submit
button is pressed:
<html>
<head>
<title>Untitled</title>
</head>
<body>
<form method="post" action="dbtest.asp">
<input type="text" name="firstname">
<input type="text" name="lastname">
<input type="text" name="zip">
<input type="Submit" name="Submit" value="Send It!">
</form>
</body>
</html>
When I click the submit button, it redirects to dbtest.mdb and I get this
error in the Internet Explorer window. The Line 22, Column 73 referrs to the
last character in the long asp line of code: Conn.execute("INSERT INTO
names VALUES fName='" & fName & "','" & lName &
HTTP 500.100 - Internal Server Error - ASP error
Internet Information Services
----------------------------------------------------------------------------
----
Technical Information (for support personnel)
a.. Error Type:
Microsoft VBScript compilation (0x800A03EA)
Syntax error
/dbtest.asp, line 22, column 73
b.. Browser Type:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)
c.. Page:
POST 60 bytes to /dbtest.asp
d.. POST Data:
firstname=John&lastname=Doe&zip=90210&Submit=Send+It%21
many examples of code but all the examples I've gone over and been directed
to have not given me strait answers.
I have an access called test.mdb located within the c:\inetpub\wwwroot\
folder where my other .htm and .asp docs are going. The database has a
single table called names. The fields within names are: fName, lName, and
zip
The code for dbtest.asp:
<html>
<head>
<title>dbsumbit</title>
</head>
<body>
<%
Dim cst,Conn,fName,lName,Zip
fName = Request.Form("firstname")
lName = Request.Form("lastname")
Zip = Request.Form("zipcode")
cst = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
Server.MapPath("/c:\inetpub\wwwroot\test.mdb")
set conn = CreateObject("ADODB.Connection")
conn.open cst
Conn.execute("INSERT INTO names VALUES fName='" & fName & "','" & lName &
"','" & Zip & "'")
%>
</body>
</html>
The above code is just one of my many attempts at making this thing work.
I've tried many different coding examples and methods and none of them have
worked. Of course, I don't know what I'm doing so that's why I'm here.
The code for my form (form.htm) that directs to dbtest.mdb after the submit
button is pressed:
<html>
<head>
<title>Untitled</title>
</head>
<body>
<form method="post" action="dbtest.asp">
<input type="text" name="firstname">
<input type="text" name="lastname">
<input type="text" name="zip">
<input type="Submit" name="Submit" value="Send It!">
</form>
</body>
</html>
When I click the submit button, it redirects to dbtest.mdb and I get this
error in the Internet Explorer window. The Line 22, Column 73 referrs to the
last character in the long asp line of code: Conn.execute("INSERT INTO
names VALUES fName='" & fName & "','" & lName &
HTTP 500.100 - Internal Server Error - ASP error
Internet Information Services
----------------------------------------------------------------------------
----
Technical Information (for support personnel)
a.. Error Type:
Microsoft VBScript compilation (0x800A03EA)
Syntax error
/dbtest.asp, line 22, column 73
b.. Browser Type:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)
c.. Page:
POST 60 bytes to /dbtest.asp
d.. POST Data:
firstname=John&lastname=Doe&zip=90210&Submit=Send+It%21