Solved

recordset

Posted on 2014-07-24
3
106 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 500 total points
ID: 40224818
then you would have to run UPDATE statements
0

Featured Post

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

691 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