Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
=TableUpdate(.T.) Doesn't Work ???
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00112382
Message ID:
00112772
Vues:
23
>Actually, it is possible to do what Gary is attempting. It may be necessary to set the KeyField, Updateable, and UpdateName for each updatable field using CURSORSETPROP(). I'm not sure that setting the key and update lists really works.
>
>The best way to find out what's going on is to use AERROR() after your unsuccessful TABLEUPDATE() to find out what error was returned by VFP or by your ODBC driver.
>
>>The resultset of a VFP SQLExec command is a VFP Cursor and not a Remote View
>>if you want to send updates with SQLEXEC you need a UPDATE SQL statement
>>as in ;
>>SQLEXEC(hConnection,"UPDATE Company SET companytype="fsdfsd" ... WHERE companycode=somevalue")
>>you can also define Remote views instead
>>
>>CREATE SQL VIEW REMOTE CONNECTION connectionname SAHRE AS
>> SELECT * FROM Compay where ...
>>and then
>>DBSETPROP all the properties
>>
>>Arnon
>>
>>> Could anyone tell me what am I doing wrong with the following SPT sentences that Remote table on SQL Server could not be updated
>>>
>>>.....
>>>Result = SQLExec(ConnectID,;
>>> " Select * From Company ;
>>> where company.CompanyCode = ?Thisform.TextField1.Value ",;
>>> "Myview")
>>>Select Myview
>>>Set MultiLocks ON
>>>=CursorSetProp("Buffering", 5)
>>>=CursorSetProp("Tables", "Company")
>>>=CursorSetProp("KeyFieldList", "CompanyCode")
>>>=CursorSetProp("SendUpdates", .T.)
>>>=CursorSetProp("UpdatableFieldList", "CompanyCode, CompanyGroup, CompanyType")
>>>

One more thing I can think off is that you may have a field of type bit (logical) which does not accept a null value.
>>>..........Editing Here .......
>>>
>>>
>>>Result = TableUpdate(.T.)
>>>If Result = .F.
>>> =Messagebox("Update Failure", 48, "Update Message")
>>> = TableRevert(.T.)
>>> Return
>>>Else
>>> =Messagebox("Update Successful", 64, "Update Message")
>>>Endif
>>>
>>>..... Always Result as False, However, if I didn't edit then update it, it ends up result = .T. ??
>>>I'm lost :-<
>>>
>>>thanks
System Analyst
Nabil B. Ghrayyeb
nabilg@hotmail.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform