Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Get information from Database
Message
De
21/04/2004 22:38:50
 
 
À
20/04/2004 23:33:18
Information générale
Forum:
Visual Basic
Catégorie:
Autre
Divers
Thread ID:
00896727
Message ID:
00897102
Vues:
11
'Hi friend!

'I might suggest the use of SQL with ADO to retrieve Data from Databases, that way is much, much better and is more easy to program.

'Ok, let's get back to the matter of this thread man, here's tha snnipet!

Option Explicit

'you have to reference the MS Access 9.0 Object Library

'Let's Declare my object, cus I will soon use it :o)
Dim MyAccess As Access.Application

Private Sub cmdRunQuery_Click()
Set MyAccess = New Access.Application

'Let's Rock and Roll Baby! Here is the code you will love most!

With MyAccess
.OpenCurrentDatabase App.Path & ("\YourDBfile.mdb") 'you decide how to work with your DB
.DoCmd.OpenQuery "YourDBQueryName" 'is here where I set the query name, check the rest of the options in this part
.CloseCurrentDatabase ' I use this after I make the query to run, this is how I do it
End With

Set MyAccess = Nothing 'Let's close this object,
'we don't want to waste memory,huh?
End Sub

'Oki Doki, I hope this can help you, have a nice day!
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform