Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Refreshing db after executing queries

Posted on 2003-11-03
4
Medium Priority
?
191 Views
Last Modified: 2010-05-03
Hi,
I'm using VB6 with access97, connecting to DB with ADO
I use one form to insert data into the DB.
I have another form with a combo box that populated with data from the DB,
The problem is that once I insert data, the combo box on the other form showes the new
data ONLY if O CLOSE the program and run it again.

How can I refresh the DB (like commit in Oracle) so I can re-populate the combo box?
thanx.
0
Comment
Question by:zolpo
4 Comments
 
LVL 3

Expert Comment

by:SQLMaster
ID: 9672011
Hi Zolpo,

After inserting data, call the refresh method of ADO recordset in your first form and after that call the refresh method of combo box on another form

Cheers

Dheeraj


0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 9672499
0
 
LVL 15

Expert Comment

by:JackOfPH
ID: 9675746
Try this one!

combo1.clear
do until Ado.Recordset.EOF
Combo1.Additem Ado.RecordSet!YourField
Ado.Recordset.Movenext
loop

JackOfPH
0
 

Accepted Solution

by:
joyful88 earned 450 total points
ID: 9683263
on your form, after inserting data:

Private Sub Insert_Click()  // or whatever event it is
    { ... your codes for inserting data into Access ...
      :
     }
     Unload Me
     Dim frmNewForm as New Form1
     frmNewForm.Show
End Sub

this reloads your form and updates your database; instead of closing your form to refresh manually, this does it for you automatically.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
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…
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…
Suggested Courses

782 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