Visual Basic Replication Problems
am 12.03.2003 06:52:58 von Aaron WeedI have been fighting with Visual Basic and replication for a few weeks, and
I finally found out a solution.
I am using Visual Basic v6 SP5, MySQL v4.0.11 Server and MyODBC 3.51.06.
How-To-Repeat:
When adding a record with Visual Basic and ADO, it adds the record to the
Master, but it doesn't replicate the record add on the Slave. There is no
error, and the bin-log file is added to.
I have found that this code did not work within Visual Basic with
replication (This will include any .addnew or .update or .delete methods):
Dim myConn As New ADODB.Connection
Dim myRS As New ADODB.Recordset
myConn.Open "DRIVER={MySQL ODBC 3.51
Driver};SERVER=192.168.10.1;DATABASE=SchedulePro;USER=root;P ASSWORD=;OPTION=
35;"
myRS.Source = "SELECT * FROM employees"
Set myRS.ActiveConnection = myConn
myRS.CursorLocation = adUseClient
myRS.Open , , adOpenDynamic, adLockOptimistic
With myRS
.AddNew
![employee_id] = 4
.Update
.Close
End With
myConn.Close
Set myRS.ActiveConnection = Nothing
'----------------------------------------------------------- ------
However, this code does work with replication on adding, deleting, and
modifying:
Dim myConn As New ADODB.Connection
myConn.Open "DRIVER={MySQL ODBC 3.51
Driver};SERVER=192.168.10.1;DATABASE=SchedulePro;USER=root;P ASSWORD=;OPTION=
35;"
myConn.Execute "INSERT INTO schedule_log (employee_number) VALUES (4)"
myConn.Close
'----------------------------------------------------------- ------
There has to be some bug on how the record is actually added to the master
just fine, but yet the replication does not occur. I hope this helps others
with the same problem. If there is a different way to access MySQL, someone
please email me with a new connection method. Thanks.
Also, if anyone can shed any light on this MAJOR bug, please ket me know
thanks...
Aaron
------------------------------------------------------------ ---------
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 bugs-thread13954@lists.mysql.com
To unsubscribe, e-mail