I have set up a MySQL db on one server, IIS 6.0 on another. Using
Frontpage I created some forms to input data. On a test page I made, I
have 4 fields. First is the ID which is autonumber (I leave alone). The
second is marked as TEXT, the third is MEDIUMTEXT, and the fourth is
DATE. This is just an example though, the problem exists in no matter
what manner I create the form.
Now here is the issue. In the TEXT fields nothing is saved into the db.
But whatever I put in the DATE field is saved. I played around a bit and
found if I put in a single letter (a for example) it will be saved in
the TEXT fields. If I put in "aa" it will not save.
Now if I create a form that is to accept just 4 fields of a numbers the
form will work properly. I.e. a form made for inputing IP addresses and
telephone numbers will work. Once I add a field for a name then the form
will only save the number.
Yet in the db itself I have no issues putting in long text phrase into
the same field (Using OpenOffice). Therefore I assume this is some issue
on how either Frontpage created the form or the webserver is sending the
data. Is there anything special I need to do to get a from made with
Frontpage to work with MySQL db? I have made numerous forms to use a MS
Access db without any issue.
Below is the code used for a test page-
<%
' FP_ASP ASP Automatically generated by a Frontpage Component. Do not Edit.
On Error Resume Next
Session("FP_Old CodePage") = Session.CodePag e
Session("FP_Old LCID") = Session.LCID
Session.CodePag e = 1252
Err.Clear
strErrorUrl = ""
If Request.ServerV ariables("REQUE ST_METHOD") = "POST" Then
If Request.Form("V TI-GROUP") = "0" Then
Err.Clear
Set fp_conn = Server.CreateOb ject("ADODB.Con nection")
FP_DumpError strErrorUrl, "Cannot create connection"
Set fp_rs = Server.CreateOb ject("ADODB.Rec ordset")
FP_DumpError strErrorUrl, "Cannot create record set"
fp_conn.Open Application("My SQL_ConnectionS tring")
FP_DumpError strErrorUrl, "Cannot open database"
fp_rs.Open "categories ", fp_conn, 1, 3, 2 ' adOpenKeySet,
adLockOptimisti c, adCmdTable
FP_DumpError strErrorUrl, "Cannot open record set"
fp_rs.AddNew
FP_DumpError strErrorUrl, "Cannot add new record set to the database"
Dim arFormFields0(3 )
Dim arFormDBFields0 (3)
Dim arFormValues0(3 )
arFormFields0(0 ) = "CategoryID "
arFormDBFields0 (0) = "CategoryID "
arFormValues0(0 ) = Request("Catego ryID")
arFormFields0(1 ) = "CategoryNa me"
arFormDBFields0 (1) = "CategoryNa me"
arFormValues0(1 ) = Request("Catego ryName")
arFormFields0(2 ) = "ID"
arFormDBFields0 (2) = "ID"
arFormValues0(2 ) = Request("ID")
FP_SaveFormFiel ds fp_rs, arFormFields0, arFormDBFields0
fp_rs.Update
FP_DumpError strErrorUrl, "Cannot update the database"
fp_rs.Close
fp_conn.Close
FP_FormConfirma tion "text/html; charset=windows-1252",_
"Form Confirmation",_
"Thank you for submitting the following information:",_
"1.asp",_
"Return to the form."
End If
End If
Session.CodePag e = Session("FP_Old CodePage")
Session.LCID = Session("FP_Old LCID")
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>ID</title>
</head>
<body>
<form method="POST" action="--WEBBOT-SELF--">
<!--webbot bot="SaveDataba se" SuggestedExt="a sp"
S-DataConnection= "MySQL" S-RecordSource="c ategories"
S-Form-Fields="Categor yID CategoryName ID" S-Form-DBFields="Categ oryID
CategoryName ID" U-ASP-Include-Url="_fpclass/fpdbform.inc" startspan
--><input TYPE="hidden" NAME="VTI-GROUP" VALUE="0"><!--#include
file="_fpclass/fpdbform.inc"--><!--webbot bot="SaveDataba se"
i-checksum="40548 " endspan -->
<p> </p>
<table border="1" width="100%" id="table1">
<tr>
<td><b>ID</b></td>
<td><input type="text" name="ID" size="20"></td>
</tr>
<tr>
<td><b>Category ID</b></td>
<td><input type="text" name="CategoryI D" size="20"></td>
</tr>
<tr>
<td><b>Category Name</b></td>
<td><input type="text" name="CategoryN ame" size="20"></td>
</tr>
</table>
<p><input type="submit" value="Submit" name="B1"><inpu t type="reset"
value="Reset" name="B2"></p>
</form>
Frontpage I created some forms to input data. On a test page I made, I
have 4 fields. First is the ID which is autonumber (I leave alone). The
second is marked as TEXT, the third is MEDIUMTEXT, and the fourth is
DATE. This is just an example though, the problem exists in no matter
what manner I create the form.
Now here is the issue. In the TEXT fields nothing is saved into the db.
But whatever I put in the DATE field is saved. I played around a bit and
found if I put in a single letter (a for example) it will be saved in
the TEXT fields. If I put in "aa" it will not save.
Now if I create a form that is to accept just 4 fields of a numbers the
form will work properly. I.e. a form made for inputing IP addresses and
telephone numbers will work. Once I add a field for a name then the form
will only save the number.
Yet in the db itself I have no issues putting in long text phrase into
the same field (Using OpenOffice). Therefore I assume this is some issue
on how either Frontpage created the form or the webserver is sending the
data. Is there anything special I need to do to get a from made with
Frontpage to work with MySQL db? I have made numerous forms to use a MS
Access db without any issue.
Below is the code used for a test page-
<%
' FP_ASP ASP Automatically generated by a Frontpage Component. Do not Edit.
On Error Resume Next
Session("FP_Old CodePage") = Session.CodePag e
Session("FP_Old LCID") = Session.LCID
Session.CodePag e = 1252
Err.Clear
strErrorUrl = ""
If Request.ServerV ariables("REQUE ST_METHOD") = "POST" Then
If Request.Form("V TI-GROUP") = "0" Then
Err.Clear
Set fp_conn = Server.CreateOb ject("ADODB.Con nection")
FP_DumpError strErrorUrl, "Cannot create connection"
Set fp_rs = Server.CreateOb ject("ADODB.Rec ordset")
FP_DumpError strErrorUrl, "Cannot create record set"
fp_conn.Open Application("My SQL_ConnectionS tring")
FP_DumpError strErrorUrl, "Cannot open database"
fp_rs.Open "categories ", fp_conn, 1, 3, 2 ' adOpenKeySet,
adLockOptimisti c, adCmdTable
FP_DumpError strErrorUrl, "Cannot open record set"
fp_rs.AddNew
FP_DumpError strErrorUrl, "Cannot add new record set to the database"
Dim arFormFields0(3 )
Dim arFormDBFields0 (3)
Dim arFormValues0(3 )
arFormFields0(0 ) = "CategoryID "
arFormDBFields0 (0) = "CategoryID "
arFormValues0(0 ) = Request("Catego ryID")
arFormFields0(1 ) = "CategoryNa me"
arFormDBFields0 (1) = "CategoryNa me"
arFormValues0(1 ) = Request("Catego ryName")
arFormFields0(2 ) = "ID"
arFormDBFields0 (2) = "ID"
arFormValues0(2 ) = Request("ID")
FP_SaveFormFiel ds fp_rs, arFormFields0, arFormDBFields0
fp_rs.Update
FP_DumpError strErrorUrl, "Cannot update the database"
fp_rs.Close
fp_conn.Close
FP_FormConfirma tion "text/html; charset=windows-1252",_
"Form Confirmation",_
"Thank you for submitting the following information:",_
"1.asp",_
"Return to the form."
End If
End If
Session.CodePag e = Session("FP_Old CodePage")
Session.LCID = Session("FP_Old LCID")
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>ID</title>
</head>
<body>
<form method="POST" action="--WEBBOT-SELF--">
<!--webbot bot="SaveDataba se" SuggestedExt="a sp"
S-DataConnection= "MySQL" S-RecordSource="c ategories"
S-Form-Fields="Categor yID CategoryName ID" S-Form-DBFields="Categ oryID
CategoryName ID" U-ASP-Include-Url="_fpclass/fpdbform.inc" startspan
--><input TYPE="hidden" NAME="VTI-GROUP" VALUE="0"><!--#include
file="_fpclass/fpdbform.inc"--><!--webbot bot="SaveDataba se"
i-checksum="40548 " endspan -->
<p> </p>
<table border="1" width="100%" id="table1">
<tr>
<td><b>ID</b></td>
<td><input type="text" name="ID" size="20"></td>
</tr>
<tr>
<td><b>Category ID</b></td>
<td><input type="text" name="CategoryI D" size="20"></td>
</tr>
<tr>
<td><b>Category Name</b></td>
<td><input type="text" name="CategoryN ame" size="20"></td>
</tr>
</table>
<p><input type="submit" value="Submit" name="B1"><inpu t type="reset"
value="Reset" name="B2"></p>
</form>
Comment