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:
00949803
Views:
17
This message has been marked as a message which has helped to the initial question of the thread.
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?
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform