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
| >
| >