Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Where to declare ADODB connection
Message
Information générale
Forum:
Visual Basic
Catégorie:
Bases de données DAO/RDO/ODBC/ADO
Divers
Thread ID:
00384533
Message ID:
00384565
Vues:
30
>Create a "Module" and make the connection public, and then make a "Public Sub Main()" in the same Module


Don't forget to show your first form in this procedure!

>Option Explicit
>Public Conn As ADODB.Connection
>Public Sub Main()
> 'This will open a global connection
> Set Conn = New ADODB.Connection
> With Conn
> 'Change the data source property in the following line
> .ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\temp\data\chamber.mdb;Persist Security Info=False"
> .Open
> End With

mdiMain.Show

>End Sub
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform