Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

fetch ms sql data from visual foxpro

Status
Not open for further replies.

engan

Programmer
Jul 15, 2001
53
ID
hi, I have a question regarding accessing ms sql data from visual foxpro. If I have 1000 records and I want to limit my grid to fetch the data 10 records at a time without any filter, what command should I use in visual foxpro. I want to have one command button to fetch the next ten record at a time. Currently I use remote view and I dont want my grid to be filled with all records from sql table.
 
look at the remote view advanced option 'number of records to fetch at a time' You will not need a command button, scrolling in the grid past the last fetched record will automatically fetch the next group.
 
fluteplr, I try to put record to fetch at a time to 10 and max records to fetch to all in remote data property, but when I browse or I use grid, I still got all records and all records were diplayed on my grid. What I want is to fetch 10 records and display just 10 records until the user click next10 records button, then it will fetch/requery the next 10 records.
 
It sounds like you may need to switch to SQLEXEC and Asynchronous execution. SQLEXEC(nHandle, "select * from whatever") is straightforward, but becomes a nightmare if you need an updateable remote view.

Asynchronous execution is a bit of a pain, which is one reason why most of us don't use it. But it allows you to repeatedly call the same SQLEXEC function (say, from a command button) and get a new batch of records at each call. You'd continue invoking the SQLEXEC at each press of the button, until SQLEXEC returned something other than 0. Robert Bradley
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top