I am creating one VB DLL project in which I am writing the functions. I am writing one function in which I am creating the database connection & storing it an object. I want to return this connection object to my calling function. The function is defined as
Public Function openConn() as Object
Dim ConnObj as New ADODB.Connection
openConn = ConnObj
The above function is written in .BAS file
I am calling the above function by statement
Conn = openConn()
which is called from the .CLS file. It gives an error
'Object Variable or With block variable not set'
I am creating the Connection Object in the .BAS file because the same Connection Object will be used by number of .CLS files.
Can anybody help me?
Thanks in advance