?
Solved

recordset

Posted on 2014-07-24
3
Medium Priority
?
108 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 70

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 70

Accepted Solution

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

Featured Post

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

770 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