Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
CursorAdapters and MySQL
Message
De
16/01/2004 16:47:56
 
 
À
16/01/2004 16:27:29
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00867653
Message ID:
00867682
Vues:
16
Hi Dan,

It works fine with SQL Server. Are you running SP1? Could you send ODBC trace taken during TABLEUPDATE execution to my e-mail address?

Thanks,
Aleksey.


>Here's the code do define my class.
>
>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
>	
>ENDDEFINE
>
>
>Then 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.
>>>
>>>However, updates via Remote Views and SQL Passthrough work with the same driver.
>>>
>>>Has anybody been able to get this to work with CursorAdapters?
>>
>>Hi Dan,
>>
>>Which CursorAdapter properties do you set and how do you set them?
>>
>>Thanks,
>>Aleksey.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform