J
Jason Penny
I've created an asp page linked to an access database,
however when I hit the submit button, i get the following
error:
<%
' FP_ASP ASP Automatically generated by a Frontpage
Component. Do not Edit.
On Error Resume Next
strErrorUrl = ""
If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
If Request.Form("VTI-GROUP") = "0" Then
Err.Clear
Set fp_conn = Server.CreateObject
("ADODB.Connection")
FP_DumpError strErrorUrl, "Cannot create
connection"
Set fp_rs = Server.CreateObject("ADODB.Recordset")
FP_DumpError strErrorUrl, "Cannot create record
set"
fp_conn.Open Application
("smc_form_ConnectionString")
FP_DumpError strErrorUrl, "Cannot open database"
fp_rs.Open "Results", fp_conn, 1, 3, 2 '
adOpenKeySet, adLockOptimistic, adCmdTable
FP_DumpError strErrorUrl, "Cannot open record set"
fp_rs.AddNew
FP_DumpError strErrorUrl, "Cannot add new record
set to the database"
Dim arFormFields0(1)
Dim arFormDBFields0(1)
Dim arFormValues0(1)
arFormFields0(0) = "Member_Name"
arFormDBFields0(0) = "Member_Name"
arFormValues0(0) = Request("Member_Name")
FP_SaveFormFields fp_rs, arFormFields0,
arFormDBFields0
If Request.ServerVariables("REMOTE_HOST") <> ""
Then
FP_SaveFieldToDB fp_rs,
Request.ServerVariables
("REMOTE_HOST"), "Remote_computer_name"
End If
If Request.ServerVariables("HTTP_USER_AGENT")
<> "" Then
FP_SaveFieldToDB fp_rs,
Request.ServerVariables("HTTP_USER_AGENT"), "Browser_type"
End If
FP_SaveFieldToDB fp_rs, Now, "Timestamp"
If Request.ServerVariables("REMOTE_USER") <> ""
Then
FP_SaveFieldToDB fp_rs,
Request.ServerVariables("REMOTE_USER"), "User_name"
End If
fp_rs.Update
FP_DumpError strErrorUrl, "Cannot update the
database"
fp_rs.Close
fp_conn.Close
FP_FormConfirmation "text/html; charset=windows-
1252",_
"Form
Confirmation",_
"Thank you
for submitting the following information:",_
"smc_form.asp",_
"Return to
the form."
End If
End If
%>
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
</head>
<body>
<form method="POST" action="smc_form.asp" webbot-action="--
WEBBOT-SELF--">
<!--webbot bot="SaveDatabase" SuggestedExt="asp" S-
DataConnection="smc_form"
S-RecordSource="Results" U-Database-
URL="fpdb/smc_form.mdb"
S-Builtin-Fields="REMOTE_HOST HTTP_USER_AGENT Timestamp
REMOTE_USER"
S-Builtin-DBFields="Remote_computer_name Browser_type
Timestamp User_name"
S-Form-Fields="Member_Name" S-Form-
DBFields="Member_Name" startspan U-ASP-Include-
Url="_fpclass/fpdbform.inc" --><input TYPE="hidden"
NAME="VTI-GROUP" VALUE="0"><!--#include
file="_fpclass/fpdbform.inc"--><!--webbot
bot="SaveDatabase" endspan i-checksum="40548" -->
<p> </p>
<table border="1" width="100%">
<tr>
<td width="50%">Name:</td>
<td width="50%"><input type="text"
name="Member_Name" size="25"></td>
</tr>
</table>
<p><input type="submit" value="Submit" name="B1"><input
type="reset" value="Reset" name="B2"></p>
</form>
</body>
</html>
Any suggestions?
however when I hit the submit button, i get the following
error:
<%
' FP_ASP ASP Automatically generated by a Frontpage
Component. Do not Edit.
On Error Resume Next
strErrorUrl = ""
If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
If Request.Form("VTI-GROUP") = "0" Then
Err.Clear
Set fp_conn = Server.CreateObject
("ADODB.Connection")
FP_DumpError strErrorUrl, "Cannot create
connection"
Set fp_rs = Server.CreateObject("ADODB.Recordset")
FP_DumpError strErrorUrl, "Cannot create record
set"
fp_conn.Open Application
("smc_form_ConnectionString")
FP_DumpError strErrorUrl, "Cannot open database"
fp_rs.Open "Results", fp_conn, 1, 3, 2 '
adOpenKeySet, adLockOptimistic, adCmdTable
FP_DumpError strErrorUrl, "Cannot open record set"
fp_rs.AddNew
FP_DumpError strErrorUrl, "Cannot add new record
set to the database"
Dim arFormFields0(1)
Dim arFormDBFields0(1)
Dim arFormValues0(1)
arFormFields0(0) = "Member_Name"
arFormDBFields0(0) = "Member_Name"
arFormValues0(0) = Request("Member_Name")
FP_SaveFormFields fp_rs, arFormFields0,
arFormDBFields0
If Request.ServerVariables("REMOTE_HOST") <> ""
Then
FP_SaveFieldToDB fp_rs,
Request.ServerVariables
("REMOTE_HOST"), "Remote_computer_name"
End If
If Request.ServerVariables("HTTP_USER_AGENT")
<> "" Then
FP_SaveFieldToDB fp_rs,
Request.ServerVariables("HTTP_USER_AGENT"), "Browser_type"
End If
FP_SaveFieldToDB fp_rs, Now, "Timestamp"
If Request.ServerVariables("REMOTE_USER") <> ""
Then
FP_SaveFieldToDB fp_rs,
Request.ServerVariables("REMOTE_USER"), "User_name"
End If
fp_rs.Update
FP_DumpError strErrorUrl, "Cannot update the
database"
fp_rs.Close
fp_conn.Close
FP_FormConfirmation "text/html; charset=windows-
1252",_
"Form
Confirmation",_
"Thank you
for submitting the following information:",_
"smc_form.asp",_
"Return to
the form."
End If
End If
%>
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
</head>
<body>
<form method="POST" action="smc_form.asp" webbot-action="--
WEBBOT-SELF--">
<!--webbot bot="SaveDatabase" SuggestedExt="asp" S-
DataConnection="smc_form"
S-RecordSource="Results" U-Database-
URL="fpdb/smc_form.mdb"
S-Builtin-Fields="REMOTE_HOST HTTP_USER_AGENT Timestamp
REMOTE_USER"
S-Builtin-DBFields="Remote_computer_name Browser_type
Timestamp User_name"
S-Form-Fields="Member_Name" S-Form-
DBFields="Member_Name" startspan U-ASP-Include-
Url="_fpclass/fpdbform.inc" --><input TYPE="hidden"
NAME="VTI-GROUP" VALUE="0"><!--#include
file="_fpclass/fpdbform.inc"--><!--webbot
bot="SaveDatabase" endspan i-checksum="40548" -->
<p> </p>
<table border="1" width="100%">
<tr>
<td width="50%">Name:</td>
<td width="50%"><input type="text"
name="Member_Name" size="25"></td>
</tr>
</table>
<p><input type="submit" value="Submit" name="B1"><input
type="reset" value="Reset" name="B2"></p>
</form>
</body>
</html>
Any suggestions?