Solved

recordset

Posted on 2014-07-24
3
93 Views
Last Modified: 2014-08-01
In vb6 I pulled up the recordset to a datagrid.  Is there a way to add records to the datagrid without accessing the db and then when I'm done adding records and making edits, then I can update the Database?

This is how I am opening the database

rec.CursorType = adOpenStatic
      rec.CursorLocation = adUseClient
      rec.LockType = adLockOptimistic
      rec.Open esql, conn, , , adCmdText


     
        Set DataGrid1.DataSource = rec
0
Comment
Question by:al4629740
  • 2
3 Comments
 
LVL 69

Expert Comment

by:Éric Moreau
ID: 40217517
I would loop through the records of your recordset and emit a INSERT statement to execute against the connection object. something like http://www.vb-helper.com/howto_ado_insert.html
0
 

Author Comment

by:al4629740
ID: 40224774
What if I am only updating the records from the db.  Would INSERT still apply?
0
 
LVL 69

Accepted Solution

by:
Éric Moreau earned 500 total points
ID: 40224818
then you would have to run UPDATE statements
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now