Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Server pass-through question
Message
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00949730
Message ID:
00949995
Views:
19
Thanks Boris,

This should also work without cursor adaptor? I will implement this with SQL pass-through. Thanks for the tip!




>If You use a VFP 8, you can use a Cursor Adapter to compose that class, There is a UpdateNameList, UpdatableFieldList properties that may help to You.
>The other way is (Thanks Cetin's for the code):
>
> cSqlSt = "SELECT IN_ItemSupplier.ID, IN_ItemSupplier.cCode,IN_ItemSupplier.cDesc "+;
>                  "AP_Supplier.cDesc AS cDescSupplier FROM IN_ItemSupplier "+;
>                  "LEFT JOIN AP_Supplier ON IN_ItemSupplier.Fk_Supplier = AP_Supplier.ID"
>
>  csql = SQLEXEC(sqlh, cSqlSt,"cCursor")
>  IF cSql > 0
>     SELECT cCursor
>     CursorSetProp('KeyFieldList','IN_ItemSupplier.ID','cCursor')
>     CursorSetProp('WhereType'   ,                   2,'cCursor')
>     CursorSetProp('Tables'      ,'IN_ItemSupplier'   ,'cCursor')
>     CursorSetProp("UpdateNameList", ;
>                             "cCode    IN_ItemSupplier.cCode,"+;
>                             "cDesc    IN_ItemSupplier.cDesc,"IN_ItemSupplier")
>     CursorSetProp('UpdatableFieldList','cCode,cDesc','IN_ItemSupplier')
>     CursorSetProp('SendUpdates',.T.,'IN_ItemSupplier')
>     CursorSetProp('Buffering',    5,'IN_ItemSupplier')
>     **** Do whatever changes in that cursor
>     TableUpdate(1, .t., "cCursor")
>  ENDIF
>
>
>
>>I'm in a rich client environment using VFP front end and SQL server as back end. All data coming from SQL server is stored in updatable cursor using SQL pass-through.
>>
>>The cursor is composed of the SQL statement below
>>
>>
>>SELECT IN_ItemSupplier.ID, IN_ItemSupplier.cCode,IN_ItemSupplier.cDesc, AP_Supplier.cDesc AS cDescSupplier FROM IN_ItemSupplier
>>LEFT JOIN AP_Supplier ON IN_ItemSupplier.Fk_Supplier = AP_Supplier.ID
>>
>>
>>I would like to update field in the IN_ItemSupplier table only. How should I proceed?
Luc Nadeau
lnadeau@neova.ca

"the theory, it is when all is known and that nothing works. The practice, it is when all works and that nobody knows why." - Albert Einstein (Nobel of physique 1921)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform