Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Common Program 4

Status
Not open for further replies.

RebelFox

Programmer
Jun 16, 2002
62
0
0
GB
I have a set of programs that all access a DB2 server ( AS400 ). In each program I end up coding an identical login form that accepts a username and password which is then validated against the DB2 user profile database.

I think I should create this login as a stand alone program that I can call from each of my projects. The program just
needs to return a 'valid user' or 'invalid user' value.

I could set up a Class Module and copy it into each program but can Class Modules have forms in them?
Is there a way of creating the effect of a class module instance with a form as a common program so I can use my
common login program like this?

Sub Proc MyProject

'
' Call logon method in DB2Server program to display
' a form, accept a usename textbox, accept a password
' textbox and validate it against the AS400 before
' returning a booleanvalue of True or False.
'
blnLoggedOn = DB2Server.LogOn ' Program & Method

'
' If Valid UserName & Password
If ReturnCode = True Then
.
. Do Processing
.
Endif

End Proc



 

re using the Win API in the real world - quite often. it is extremely useful and there are many utilities which have been provided so you don't have to reinvent the wheel. consider the Win API as a super-class for the entirety of windows environment and the operating system itself.

I've also seen some of strongm's Win API references on this site, and they are very good. probably the biggest problem with the Win API is that it is so extensive, it's difficult to know and understand everything it provides, in addition to understanding how to make use of it (properly).

in any case, as long as you have a solution that works, and you are comfortable with it's operation and maintainability, that's all that really matters.
 
Earlier I asked what is the difference between an ActiveX EXE and an ActiveX DLL. If anubody needs a good definition, I found a good reference in the Wrox book, 'Beginning Visual Basic 6 Apllication Development'.

ActiveX .DLL
-------------

+Cannot run on its own ( i.e. has to be called )
+Is faster
-Must be registered on each individual machine

ActiceX EXE
-----------

+Can run on its own
+Can be run from a central network drive
-Is slower







Dazed and confused
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top