Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Passthrough Command
Message
From
18/04/2002 03:38:49
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
17/04/2002 22:54:51
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00646153
Message ID:
00646203
Views:
13
>Hi,
>
>I use sqlpassthrough to update the remote tables. Here is the code
>
>in the load event of my form, I place the following code
>
>nHandle = Sqlconnect("bbfsdsn")
>csql = [Select callrefno, calldate, calltime from Accounting!callinv]
>nResult = Sqlexec(nHandle, csql, "Cur_callinv")
>
>Cursorsetprop("Tables","callinv","cur_callinv")
>Cursorsetprop("KeyFieldList","callrefno","cur_callinv")
>Cursorsetprop("UpdatableFieldList","calldate,calltime","cur_callinv")
>Cursorsetprop("SendUpdates",.T.,"cur_callinv")
>Cursorsetprop("Buffering",5,"Cur_callinv")
>
>I also placed the following code in the init event
>
>thisform.grid1.RecordSource = "cur_callinv"
>thisform.grid1.column1.ControlSource = "cur_callinv.callrefno"
>thisform.grid1.column2.ControlSource = "cur_callinv.calldate"
>thisform.grid1.column3.ControlSource = "cur_callinv.calltime"
>
>I placed the following code in the click event of mybutton
>
>Tableupdate(.T.,.T.,"cur_callinv")
>thisform.Release()
>
>The problem is everytime I change a field value in the grid and hit the updated button, it does not update the remote data. What seems to be wrong?

Mike,
UpdateNameList is missing. You should provide a list specifying KEY FIELD + all updatable field list as 'ViewName RemoteTable.RemoteFieldName,...'. Probably yours would look like :
Cursorsetprop("UpdateNameList",;
  "callrefno callinv.callrefno, "+;
  "calldate callinv.calldate, "+;
  "calltime callinv.calltime","cur_callinv")
Remember though docs doesn't make it clear KEY FIELD(s) is in list though it's not in updatablefieldlist.
PS : Adding "WhereType",1 might be usefull.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform