|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
re-use code for multiple applicationsI have a sql server database enterprise database, v. 8. I have multiple visual basic applications connecting to this database -- the apps have to be individual they cannot be all combined into one. I would like to re-use some of the code for all the applications including the code for creating the adodb connection to the database, verifying users and some other initial validations that are common to all the applications when they start up. As of now the code resides in a global module but when I copy and paste the global module to the other applications there is more work to be done because sometimes variable names are different in each application, example one application may have Public sqlConnection As New ADODB.Connection in its global module while another application will call the same connection as Public myDB As New ADODB.Connection. So how can I re-use the common functions and variables with minimum changes in all applications? Should I use class or activex control? Any examples or samples on the web that I can look at will also help. Thank you very much for taking the time to answer the questions.
Show quote
Hide quote
"Sue" <sea_***@hotmail.com> wrote in message Create an activeX dll and move all the code into a class module in the dll. news:1142026236.307635.295090@i40g2000cwc.googlegroups.com... > Hi, > > I have a sql server database enterprise database, v. 8. I have multiple > visual basic applications connecting to this database -- the apps have > to be individual they cannot be all combined into one. I would like to > re-use some of the code for all the applications including the code for > creating the adodb connection to the database, verifying users and some > other initial validations that are common to all the applications when > they start up. As of now the code resides in a global module but when I > copy and paste the global module to the other applications there is > more work to be done because sometimes variable names are different in > each application, example one application may have Public sqlConnection > As New ADODB.Connection in its global module while another application > will call the same connection as Public myDB As New ADODB.Connection. > So how can I re-use the common functions and variables with minimum > changes in all applications? Should I use class or activex control? Any > examples or samples on the web that I can look at will also help. > > Thank you very much for taking the time to answer the questions. If you make it Global Multi Use it will act like a module but it might not be the best way to do it. I'd suggest renaming everything in your app that relates to this code as you'll find it is suprisingly quick to do. Just rename the relevant variable/property/function and push ctrl-f5 to find the problems. Michael
Show quote
Hide quote
"Sue" wrote: Michael C's suggestion is one way.> Hi, > > I have a sql server database enterprise database, v. 8. I have multiple > visual basic applications connecting to this database -- the apps have > to be individual they cannot be all combined into one. I would like to > re-use some of the code for all the applications including the code for > creating the adodb connection to the database, verifying users and some > other initial validations that are common to all the applications when > they start up. As of now the code resides in a global module but when I > copy and paste the global module to the other applications there is > more work to be done because sometimes variable names are different in > each application, example one application may have Public sqlConnection > As New ADODB.Connection in its global module while another application > will call the same connection as Public myDB As New ADODB.Connection. > So how can I re-use the common functions and variables with minimum > changes in all applications? Should I use class or activex control? Any > examples or samples on the web that I can look at will also help. > > Thank you very much for taking the time to answer the questions. > I would consider creating ActiveX Dlls and then utilize MTS (COM+) for your middle layer. Show quoteHide quote "Horses for courses" <g> -ralph
Why ?? (Path/File access error (Error 75)
VB.NET or C++.NET or C# Password Change how to convert string to date? TransparentBlt and Autoredraw issues (refresh isnt solving it) Picturebox fit newbe question NTFS File Access in VB6 Sub or Function is not defined Control similar to MS Access List Box write to disk and permissions |
|||||||||||||||||||||||