MySQL db - data not saved

S

SBN Services

I have set up a MySQL db on one server, the 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.

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.

Yet in the db itself I have no issues putting in long text phrase into the
same field. 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.
 
S

Stefan B Rusynko

I don't use MySql, and w/o seeing your sql string to add/update the DB records it is difficult for anyone to advise you what you may
be doing wrong

But for new records
- never try to send an ID field from a form to a DB w/ autonumber set for the field for new records
- remove the ID field from your form (your DB should generate it for any new records)

And for Updating records open the recordset for that ID as a criteria and again just update the other fields





| I have set up a MySQL db on one server, the 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.
|
| 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.
|
| Yet in the db itself I have no issues putting in long text phrase into the
| same field. 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.
 
S

Sam White

Here is a basic sample form. Right now the biggest issue is that in TEXT
fields I can not enter more than one character, or else nothing will be
saved. I did find on Google this

http://groups.google.com/group/mailing.database.mysql-win32/browse_thread/thread/
74531bc25d2b7377/797a5539cf327a02%23797a5539cf327a02?sa=X&oi=groupsr&start=2&num=3

sadly there was no replies. I have found numerous other people with the
same issue, but these are all older posts with no responses. Yet, I know
people are using Frontpage to make forms to input data into a MySQL db.

If I create a form for a table that is JUST numbers, and type just
numbers into the form the db + form has no issues. The ID field is even
automatically numbered. Yet any non-numerical data for some reason is
just not accepted. I do not know code, so I am at a great dis-advantege.
__________________________________________________________________________
<%
' FP_ASP ASP Automatically generated by a Frontpage Component. Do not Edit.

On Error Resume Next
Session("FP_OldCodePage") = Session.CodePage
Session("FP_OldLCID") = Session.LCID
Session.CodePage = 1252
Err.Clear

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("MySQL_ConnectionString")
FP_DumpError strErrorUrl, "Cannot open database"

fp_rs.Open "categories", 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(3)
Dim arFormDBFields0(3)
Dim arFormValues0(3)

arFormFields0(0) = "CategoryID"
arFormDBFields0(0) = "CategoryID"
arFormValues0(0) = Request("CategoryID")
arFormFields0(1) = "CategoryName"
arFormDBFields0(1) = "CategoryName"
arFormValues0(1) = Request("CategoryName")
arFormFields0(2) = "ID"
arFormDBFields0(2) = "ID"
arFormValues0(2) = Request("ID")

FP_SaveFormFields fp_rs, arFormFields0, arFormDBFields0


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:",_
"1.asp",_
"Return to the form."

End If
End If

Session.CodePage = Session("FP_OldCodePage")
Session.LCID = Session("FP_OldLCID")

%>
<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="SaveDatabase" SuggestedExt="asp"
S-DataConnection="MySQL" S-RecordSource="categories"
S-Form-Fields="CategoryID CategoryName ID" S-Form-DBFields="CategoryID
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="SaveDatabase"
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>CategoryID</b></td>
<td><input type="text" name="CategoryID" size="20"></td>
</tr>
<tr>
<td><b>CategoryName</b></td>
<td><input type="text" name="CategoryName" size="20"></td>
</tr>
</table>
<p><input type="submit" value="Submit" name="B1"><input type="reset"
value="Reset" name="B2"></p>
</form>

____________________________________________________________________________________________________________________________
 
S

Stefan B Rusynko

TBMK
- the FP DBRW/DBIW does not support MySql (only Access)
- so it probably does not recognize your fields or field sizes in MySql
Check for a PHP or ASP script that does




|
| Here is a basic sample form. Right now the biggest issue is that in TEXT
| fields I can not enter more than one character, or else nothing will be
| saved. I did find on Google this
|
| http://groups.google.com/group/mailing.database.mysql-win32/browse_thread/thread/
| 74531bc25d2b7377/797a5539cf327a02%23797a5539cf327a02?sa=X&oi=groupsr&start=2&num=3
|
| sadly there was no replies. I have found numerous other people with the
| same issue, but these are all older posts with no responses. Yet, I know
| people are using Frontpage to make forms to input data into a MySQL db.
|
| If I create a form for a table that is JUST numbers, and type just
| numbers into the form the db + form has no issues. The ID field is even
| automatically numbered. Yet any non-numerical data for some reason is
| just not accepted. I do not know code, so I am at a great dis-advantege.
| __________________________________________________________________________
| <%
| ' FP_ASP ASP Automatically generated by a Frontpage Component. Do not Edit.
|
| On Error Resume Next
| Session("FP_OldCodePage") = Session.CodePage
| Session("FP_OldLCID") = Session.LCID
| Session.CodePage = 1252
| Err.Clear
|
| 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("MySQL_ConnectionString")
| FP_DumpError strErrorUrl, "Cannot open database"
|
| fp_rs.Open "categories", 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(3)
| Dim arFormDBFields0(3)
| Dim arFormValues0(3)
|
| arFormFields0(0) = "CategoryID"
| arFormDBFields0(0) = "CategoryID"
| arFormValues0(0) = Request("CategoryID")
| arFormFields0(1) = "CategoryName"
| arFormDBFields0(1) = "CategoryName"
| arFormValues0(1) = Request("CategoryName")
| arFormFields0(2) = "ID"
| arFormDBFields0(2) = "ID"
| arFormValues0(2) = Request("ID")
|
| FP_SaveFormFields fp_rs, arFormFields0, arFormDBFields0
|
|
| 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:",_
| "1.asp",_
| "Return to the form."
|
| End If
| End If
|
| Session.CodePage = Session("FP_OldCodePage")
| Session.LCID = Session("FP_OldLCID")
|
| %>
| <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="SaveDatabase" SuggestedExt="asp"
| S-DataConnection="MySQL" S-RecordSource="categories"
| S-Form-Fields="CategoryID CategoryName ID" S-Form-DBFields="CategoryID
| 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="SaveDatabase"
| 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>CategoryID</b></td>
| <td><input type="text" name="CategoryID" size="20"></td>
| </tr>
| <tr>
| <td><b>CategoryName</b></td>
| <td><input type="text" name="CategoryName" size="20"></td>
| </tr>
| </table>
| <p><input type="submit" value="Submit" name="B1"><input type="reset"
| value="Reset" name="B2"></p>
| </form>
|
| ____________________________________________________________________________________________________________________________
|
|
| Stefan B Rusynko wrote:
| > I don't use MySql, and w/o seeing your sql string to add/update the DB records it is difficult for anyone to advise you what you
may
| > be doing wrong
| >
| > But for new records
| > - never try to send an ID field from a form to a DB w/ autonumber set for the field for new records
| > - remove the ID field from your form (your DB should generate it for any new records)
| >
| > And for Updating records open the recordset for that ID as a criteria and again just update the other fields
| >
| >
 
S

Sam White

Thanks. I was hoping I could do this within Frontpage because I do not
know how to code myself. But, PHP is pretty simple from what I have
worked with in the past in editing php files.

I will say this to any that have a similar issue. Do not waste your
money on programs like ASPRunner or Codecharge. I tried the demos out
and they are worthless. If you want to do a db in Frontpage it looks
like MS SQL or Access is the only choices.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top