Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Where to declare ADODB connection
Message
General information
Forum:
Visual Basic
Category:
Database DAO/RDO/ODBC/ADO
Miscellaneous
Thread ID:
00384533
Message ID:
00384565
Views:
33
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform