Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Server 2008 table as a record source
Message
From
17/02/2016 16:07:36
 
 
To
17/02/2016 10:34:54
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 8.1
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Desktop
Miscellaneous
Thread ID:
01620689
Message ID:
01631631
Views:
54
Likes (1)
>>>Even though I can add, amend, and delete records in a table in a SQL server using SQL passthrough and can create a view too using an odbc driver to create a connection
>>>What I don't know is what the best way of having either of these as a record source in a grid, I would like to requery this grid at regular intervals, say one a minute
>>
>>IMO cursoradapter, as you do not even to look into SafeSelect technique to be used as a source for grids.
>>
>>llOK = caYourTable.CursorRefresh()
>
>Actually wrong (writing this to myself as a note for the next time), the .cursorRefresh() and Refresh() and Requery() will all reexecute CA's .selectCmd as it was when the CA was instantiated, no matter what you set it to meanwhile. Only .cursorFill() will take the newly set .selectCmd and query using that.
>
>BTW, if you've set the first parameter of .cursorFill() to .t. and the .cursorSchema is empty, it will not give you an error (you can catch it in .afterCursorFill(), if lResult=.f., with aError(), it will just not reopen the cursor.
>
>And it does close and reopen the cursor, so safe select is still required, if you use a grid.

CursorRefresh need to uses a parameters .selectCmd. it not change the cursor file.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform