Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Class Data Connection with COM
Message
From
10/10/2001 15:40:08
 
 
To
10/10/2001 14:21:43
General information
Forum:
Visual Basic
Category:
Database DAO/RDO/ODBC/ADO
Miscellaneous
Thread ID:
00566576
Message ID:
00566628
Views:
8
>Hi -
>
>I have created a all that contains all of the Business Objects for a program. I have the startup for the dll as Sub Main so that a database connection will be made the first time the dll is called. It works great if I hard code the database location into the Sub Main but I want to be able to pass parameters from the UI to the Sub Main that defines the connection string for the data connection.
>
>Is this possible??
>
>Thanks,
>
>Nichole

You could base the connection on a udl file, this way if you need to change DB's location say from your development to the production server you just change the UDL instead of the code. Although if this DLL is heavily used it could affect performance because of the file I/O.

I think a better approach is to create a method of the class that receives the parameters to create the connection. This way you don't need a Sub Main() as everything is included in the class.

Just my .02
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform