Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How abour a delete/requery question?
Message
From
15/09/2003 02:44:03
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
15/09/2003 01:00:08
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00828897
Message ID:
00828903
Views:
17
>Hi all,
>
>Just ol' Ric here again, wondering about something new (to me anyway).
>
>I have a remote view to an SQL Table. It is all working fine (the view) I think. I can browse, add, and edit the data. But then, I cannot seem to get an accurate view update without closing the view. First - I just select myview from the project manager (just testing this out), and then click on the browse button. From the command window here is what I do:
>
>
=cursorsetprop('buffering',3,'myview')
>browse
>*-- (there is already one record)
>*-- (CTRL+Y to add a new record)(fill in some stuff - 
*still on the new record; ESC to clear the browse)
>mytest=tablueupdate(.t.)
>*-- mytest returns .T.
>browse
>*-- (the new record is there - also in SQL)
>DELETE FOR myview.testvalue > 1
>mytest=tableupdate(.t.)
>*-- mytest is .T.
>browse
>*-- the record is gone because of my set deleted, *
but I can still see the RECNO/RECC at bottom as 1 of 2)
>*-- (record is also gone from SQL Table)
>SELECT myview
>*-- I read a thread which suggest a new select of the view prior to a requery)
>mytest=REQUERY()
>*-- AHA!! mytest returns -1.  AERROR() returns 1526.  
*Why? I don't know.  But this must be the problem, eh?
>*-- BTW, I also tried mytest=REQUERY('myview') and got the same thing
>browse
>*-- the record is gone because of my set deleted, 
*but I can still see the RECNO/RECC at bottom as 1 of 2
>*-- record is also gone from SQL Table.  ESC to clear the browser
>SET DELETED OFF
>browse
>*-- I can now see the record as marked for deletion)
>
>So, why does my requery not work? I really have tried all manner of things, but the only one that works is when I close the view and reopen it. Curiouser etc...
>
>TIA
>
>Ric

Ric,
Before checking anything else check other members of aerror() returned error. It generall has 'why failed' info. 1526 tells only that it's an ODBC error. ie:
*...
if myTest < 0
 errHand()
endif
*...

Function errHand
lcError=''
Aerror(arrCheck)
For ix=1 to 7
  lcError = lcError+trans( arrCheck [ix])+ chr(13)
Endfor
Messagebox(lcError,0,'Error def.')
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
Next
Reply
Map
View

Click here to load this message in the networking platform