Updating database from datagrid
These steps assume Windows 2000 for the operating system. On a default installation of VB6 or Visual Studio 6, the BIBLIO. Note: If VB was installed in a different location on your system, navigate to the appropriate folder. MDB sample database file on your system at all, you can download it here.
On other versions of Windows, some steps may vary slightly. MDB sample database should reside in the folder C:\Program Files\Microsoft Visual Studio\VB98. In that case, copy the file to the folder of your choice, and navigate to that folder to select the database for this step.
A recordset that uses a forward-only cursor is not directly updateable and can only be scrolled from beginning to end (i.e., "Move Next" is the only "Move" method that can be used with this type of cursor).
Forward-only cursors offer optimal performance in exchange for feature limitations.
or should you update after closing the grid/form, etc.? I've got a lot to learn I know, but I have heard that Accept Changes should not be used with a Data Set because it actually may create a situation where the Data Set (in memory) is "updated", but not the disk database file, and later when you use "Update", vb thinks the changes have already been made.
Also, can you tell me the best book to buy that fully explains the Data Grid View control? Interesting that not a lot of people are using the datagridview object yet. In my example (from an app I am currently working on) I add data to the new row to the datagridview. Data Grid View Cell Event Args) Handles dgr Mod Sub Detail. This was mentioned in another topic in this group, and in a book "Programming VB. I don't understand the whole thing, but I'm going to keep track of your thoughts to see if I understand them better later on.
Recordset object with a query to display all the rows in the table.The trick is to add the row to the underlying data Table which is the datasource of the datagridview: Private Sub dgr Mod Sub Detail_Cell End Edit(By Val sender As Object, By Val e As System. Rich wrote: Interesting that not a lot of people are using the datagridview object yet. In my example (from an app I am currently working on) I add data to the new row to the datagridview. Data Grid View Cell Event Args) Handles dgr Mod Sub Detail. or should you update after closing the grid/form, etc.? I'm still so new at this that I'm just feeling my way. Is this something that should be inserted into one of the grid's events?Now days, almost any time you write full fledged database application you will want to use ADO. Prior to VB6 and the introduction of ADO (Active X Data Objects), VB programmers would generally use DAO (Data Access Objects) to interact with local databases such as MS Access and use RDO (Remote Data Objects) to interact with client/server databases such as Oracle and SQL Server.Along with this, as your applications become more and more complex you will probably not want to rely on Visual Basic's data controls, but instead use the ADO objects directly. The concept behind Visual Basic ADO was Universal Data Access (UDA), where one database access method could be used for any data source; it was designed to replace both DAO and RDO.