General information
Category:
Database DAO/RDO/ODBC/ADO
>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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only