Hi,
I am trying to modify some ASP pages that (already) work with an Access
database so that they will work with mySQL database instead. (an example is
below)
I have been able to read data from mysql and the edit page SEEMS to work -
no errors from ASP - however the database is not updated.
My first thought is that the ADO recordset is actually NOT updating because
the parameters are not right.
the 1, and the 3 in "CmdUpdateRecord.Open MYSQL, DataConn, 1, 3" is not
correct.
My second thought is that mysql is not going to allow ASP to update the
record via ADO with a select statement.
The sql statement will have to be "update etc etc" rather than "Select etc
etc"
Obviously I am hoping the first thought is right - less editing ;-)
SO
Does anyone out there have experience (and an answer) to how to properly
use ASP, ADO vbscript code with mySQL?
thanks
Harry
PS PLEASE EMAIL ME directly along with a post to the group. The digest
version comes late in the day and is hard to search thru. (You guys POST
ALOT of emails!)
There is the example editing page in its original form.
**************************************************
<% ID = 7 %>
<% NAME = "Joe Smoe" %>
<% MESSAGE = "This is another test" %>
<%
' declaring variables
' not neccesary but a good habit
Dim DataConn
Dim CmdUpdateRecord
Dim MYSQL
Set DataConn = Server.CreateObject("ADODB.Connection")
Set CmdUpdateRecord = Server.CreateObject("ADODB.Recordset")
' The line below shows how to use a system DSN instead of a DNS-LESS connection
' DataConn.Open "DSN=System_DSN_Name"
DataConn.Open "DBQ=" & Server.Mappath("../_database/database.mdb") &
";Driver={Microsoft Access Driver (*.mdb)};"
MYSQL = "SELECT some_table.* FROM some_table WHERE (ID = " & ID & ")"
CmdUpdateRecord.Open MYSQL, DataConn, 1, 3
CmdUpdateRecord.Fields("NAME") = NAME
CmdUpdateRecord.Fields("MESSAGE") = MESSAGE
CmdUpdateRecord.Update
' closing objects and setting them to nothing
' not neccesary but a good habit
CmdUpdateRecord.Close
Set CmdUpdateRecord = Nothing
DataConn.Close
Set DataConn = Nothing
%>
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php