DEFINE CLASS Customers as CursorAdapter cConnStr = "<<myconnstring>>" Tables = "Customers" KeyFieldList = "CustomerID" UpdatableFieldList = "CustomerID, " +; "CompanyName, " +; "ContactName, " +; "ContactTitle, " +; "Address, " +; "City, " +; "Region, " +; "PostalCode, " +; "Country, " +; "Phone, " +; "Fax" UpdateNameList = "CustomerID Customers.CustomerID, " +; "CompanyName Customers.CompanyName, " +; "ContactName Customers.ContactName, " +; "ContactTitle Customers.ContactTitle, " +; "Address Customers.Address, " +; "City Customers.City, " +; "Region Customers.Region, " +; "PostalCode Customers.PostalCode, " +; "Country Customers.Country, " +; "Phone Customers.Phone, " +; "Fax Customers.Fax" AllowUpdate = .t. AllowInsert = .t. AllowDelete = .t. SendUpdates = .t. Alias = "Customers" BufferModeOverride = 5 FUNCTION Init(lcCustomerID) as Boolean LOCAL lnCon as Integer, llRetVal as Boolean SET MULTILOCKS ON lnCon = SQLSTRINGCONNECT(this.cConnStr) IF lnCon > 0 WITH This .DataSource = lnCon .SelectCmd = ; "select * from Customers where CustomerID = ?lcCustomerID" .DataSourceType = "ODBC" IF NOT .CursorFill() llRetVal = .f. ELSE llRetVal = .t. ENDIF ENDWITH ELSE llRetVal = .f. ENDIF ENDFUNC FUNCTION Destroy() IF This.DataSource > 0 SQLDISCONNECT(This.DataSource) ENDIF RETURN DODEFAULT() ENDFUNC ENDDEFINEThen I do:
loCustomers = NEWOBJECT('Customers', 'test.prg', NULL, "ALFKI")Then browse the cursor, make a change and issue a TABLEUPDATE(). TABLEUPDATE() returns FALSE. I can get the following error message:
Connectivity error: Unable to retrieve specific error information. Driver is probably out of resources>>I'm having problems with CursorAdapters and MySql database. The database will not update. I've done some research on this and found that this is a known problem. It apparently has been reported to Microsoft, but they claim it is a problem with the ODBC Driver provided by MySql.