Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
=TableUpdate(.T.) Doesn't Work ???
Message
 
To
29/06/1998 01:55:14
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00112382
Message ID:
00112443
Views:
27
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")
>>
>>..........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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform