|
-
Jun 10th, 2008, 12:35 AM
#1
Thread Starter
Lively Member
How to set Global Declaration, or how to set sub main as the startup form
Dim con As New OleDb.OleDbConnection
Dim ds As New DataSet
Dim adapt As New OleDb.OleDbDataAdapter
Dim sql As String
i want to declare the following in a module and set a sub main() in the module and call form1.show,
but i cant set the submain as the startup form.
-
Jun 10th, 2008, 12:59 AM
#2
Re: How to set Global Declaration, or how to set sub main as the startup form
Please use the radio buttons provided to specify your version in future.
I assume that you are using VB 2005 or VB 2008, in which case you would have to disable the Application Framework to use a Main method as your entry point. The preferred alternative is to use the Startup event to do whatever you would normally do in a Main method.
As for your plan to use a module for those variables, it could be forgiven, if not recommended, for the DataSet and OleDbConnection, but certainly not for the OleDbDataAdapter and the String.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|