Link to home
Start Free TrialLog in
Avatar of wilko100
wilko100

asked on

How do i exeucte a query thats in an access database through VB6?

I have an access database with several querys in and a VB6 program the manipulates access. I want to be be able to add an 'update' button that copys the contects from one access table then pastes it in an empty access table. This table maybe updated so it needs to overwrite what may already be in it.
I have included the main code so far but its the middle bit i havn't got!
Private Sub btnUpdate_Click()
    Dim rA As Integer
    Dim db As New ADODB.Connection
    Dim sSQL As String
    
   
   db.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source = \\Server\test Database\testDatabase.mdb"
   db.Open
  
      MsgBox "Completed!!"
   
      db.Close
      Set db = Nothing
End Sub

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of jpeca
jpeca
Flag of Serbia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of clarkscott
clarkscott
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of wilko100
wilko100

ASKER

Sorry been away, thanks you guys sorted it