Solved

recordset

Posted on 2014-07-24
3
96 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 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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…
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…

776 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