|
Home > Archive > Visual FoxPro SQL Queries > February 2006 > SQL pass through
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
|
| Hi,
i'm a bit confused by SQL pass through. When i execute a select command into
a cursor and i refresh my forms recordsource property, i can use the fetched
data in my form. As far as i know, the data has been fetched from the server
into the cursor and now there is no link between the two. If that is so, if
datachanges in the cursor are made, i have to execute a new sqlexec command
but now with a update, or not? In all docs and internet links, i've been
given the idea that is could be solved by setting the correct cursorsetprop
and call a tableupdate command. Allthough it seemed not logic, i tried this,
but unsuccefully. I tried:
thisform.grid1.RecordSource = ""
SQLEXEC(thisform.lnConn,"select * from test","result")
SET MULTILOCKS ON
CURSORSETPROP("Tables" ,'GroupList','result
')
CURSORSETPROP("UpdateNameList","waarom",'result')
CURSORSETPROP("UpdatableFieldList","waarom",'result')
CURSORSETPROP("KeyFieldList","waarom",'result')
CURSORSETPROP("SendUpdates",.t., 'result')
CURSORSETPROP("Buffering",5,'result')
thisform.grid1.RecordSource = "result"
thisform.Refresh()
I have a button with a tableupdate(.T.)
When i make changes and press the button, nothing happens, when i want to
reload the data, the warning 'table buffor for alias result contains
uncommitted changes.
Can anyone help me, understand this?
Thanks!
Rotsj
P.s. i understand that for the exeample above, a remote view would be the
best solution. As i have to create forms with many selection options for the
user, wich the user can fill or leave empty, i want to create the sql
command interactively, as there is no way (or is there) that you can create
a parameterized remote view, in wich you can check if the parameter is empty
or not, and if it's empty all data must show.
| |
| Fred Taylor 2006-02-03, 11:24 am |
| Your best bet for understanding this would be to crete a remote view that
works for updating and using the GENDBC program to look at what gets defined
for that view.
--
Fred
Microsoft Visual FoxPro MVP
"Rotsj" <r.knipscheer@home.nl> wrote in message
news:drv103$j28$1@ne
ws6.zwoll1.ov.home.nl...
> Hi,
>
> i'm a bit confused by SQL pass through. When i execute a select command
> into
> a cursor and i refresh my forms recordsource property, i can use the
> fetched
> data in my form. As far as i know, the data has been fetched from the
> server
> into the cursor and now there is no link between the two. If that is so,
> if
> datachanges in the cursor are made, i have to execute a new sqlexec
> command
> but now with a update, or not? In all docs and internet links, i've been
> given the idea that is could be solved by setting the correct
> cursorsetprop
> and call a tableupdate command. Allthough it seemed not logic, i tried
> this,
> but unsuccefully. I tried:
>
> thisform.grid1.RecordSource = ""
> SQLEXEC(thisform.lnConn,"select * from test","result")
> SET MULTILOCKS ON
> CURSORSETPROP("Tables" ,'GroupList','result
')
> CURSORSETPROP("UpdateNameList","waarom",'result')
> CURSORSETPROP("UpdatableFieldList","waarom",'result')
> CURSORSETPROP("KeyFieldList","waarom",'result')
> CURSORSETPROP("SendUpdates",.t., 'result')
> CURSORSETPROP("Buffering",5,'result')
>
> thisform.grid1.RecordSource = "result"
> thisform.Refresh()
>
> I have a button with a tableupdate(.T.)
>
> When i make changes and press the button, nothing happens, when i want to
> reload the data, the warning 'table buffor for alias result contains
> uncommitted changes.
>
>
> Can anyone help me, understand this?
>
> Thanks!
>
> Rotsj
> P.s. i understand that for the exeample above, a remote view would be the
> best solution. As i have to create forms with many selection options for
> the
> user, wich the user can fill or leave empty, i want to create the sql
> command interactively, as there is no way (or is there) that you can
> create
> a parameterized remote view, in wich you can check if the parameter is
> empty
> or not, and if it's empty all data must show.
>
>
|
|
|
|
|