Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. sponsors. rss.
 From: Mike Gagnon
  Where is Mike Gagnon?
 Pointe Claire
 Canada
 Mike Gagnon
 To: Stary
  Where is Stary?
 Ljubljana
 Slovenia
 Stary
 Tags
Subject: RE: Updating from cursor to standalone DBF
Thread ID: 202703 Message ID: 202704 # Views: 50 # Ratings: 0
Version: Visual FoxPro 9 Category: Databases, Tables and SQL Server
Date: Sunday, November 09, 2008 5:48:37 PM         
   


> I set a grid's RecordSourceType to 1 (alias) and the RecordSource to a name of a standalone table (MyTable.dbf). It works fine and the user can change values in the table for all columns with ReadOnly property set to .F.. Just like an old Browse command.
>
> Ok, now I want the user could filter the table in the grid. It could be done with SET FILTER command and refreshing the grid, but that's not the way I want to go, because of »set filter«'s slow performances.
> I'd like to make a SQL statement, put the results in the cursor and refresh the grid with RecordSource set to the name of the cursor instead of the master MyTable.dbf. Well, it would be ok, the only poblem is - if the user changes values in the grid it's not automatically stored in the master table (MyTable.dbf) as it was in the first solution without the cursor.
>
> I know it could be done with adding some »Save« button and running a procedure with Update statements, but I wonder if there is an easier way. I know also that using a view could be a solution, but since it is a standalone table without database, I don't know if it could be done.
>
> In past, I've already do something similary on SQL server - binding the cursor created with a SQL statement with a table from database connection, setting a couple of Cursorsetprop and it works. Now I can't do it in the simpler environment – or is it possible?

Have a look at CursorAdapter Class
Or use a regular cursor and use the GetFldState to see if anything changed in the data.

Mike Gagnon
Refox XI +(English version)



COMPLETE THREAD
Updating from cursor to standalone DBF Posted by Stary @ 11/9/2008 5:27:19 PM
RE: Updating from cursor to standalone DBF Posted by Mike Gagnon @ 11/9/2008 5:48:37 PM
RE: Updating from cursor to standalone DBF Posted by Stary @ 11/15/2008 10:35:46 PM
RE: Updating from cursor to standalone DBF Posted by Barbara Peisch @ 11/9/2008 9:06:38 PM
RE: Updating from cursor to standalone DBF Posted by Stary @ 11/15/2008 10:53:56 PM
RE: Updating from cursor to standalone DBF Posted by Stefan Wuebbe @ 11/15/2008 11:13:13 PM
RE: Updating from cursor to standalone DBF Posted by Barbara Peisch @ 11/16/2008 3:06:24 AM
RE: Updating from cursor to standalone DBF Posted by Stary @ 11/16/2008 4:26:29 AM
RE: Updating from cursor to standalone DBF Posted by Bernard Bout @ 11/10/2008 4:22:51 PM
RE: Updating from cursor to standalone DBF Posted by Stary @ 11/15/2008 11:01:01 PM
RE: Updating from cursor to standalone DBF Posted by Bernard Bout @ 11/18/2008 3:03:35 AM