?
Solved

Refreshing db after executing queries

Posted on 2003-11-03
4
Medium Priority
?
186 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
[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
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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

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…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…
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

719 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