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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I can't find info on this !!!

Status
Not open for further replies.

rcraig12

Technical User
Jan 22, 2003
40
GB
Is it possible to init a class in vb with an arg?

ie

Set DB = new myDBClass ( dbConn )

any help would be appreciated
 
If this is for VB 6, you might be better off in forum222. For VB.NET, try forum796.

------------------------------------------------------------------------------------------------------------------------
"Men occasionally stumble over the truth, but most of them pick themselves up and hurry off as if nothing ever happened."
- Winston Churchill
 
Parameters are not allowed on constructors. Class_Initialize cannot take any parameters so the constructor cannot take any parameters either.
 
thanks for the info - I didn't think it could but hey ive been wrong before. Hence the post.

I am building a DB class and was hoping to pass the connection info to the database during initialisation.

Instead of the familiar:

Set myDB = new DBObject
mydb.connection = "bla"

Thanks again...

:D
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top