Click to See Complete Forum and Search --> : Database Programming using DLL


gudipallyn
April 4th, 2001, 11:15 PM
Hi,
for Example
I have created an activex dll project in vb and opened a class by name class1.Where i have written a function getdb()in this function i wrote the following code which gives the database connection

public function getdb()
dim conn as adodb.connection
set conn =new adodb.connection
conn.open"dsn="";uid=";Pwd="";"
End function

Now i created another class by name class2 in the same dll and wrote a function

GetRecords(s as double,y as double)as double

Now i want to use that class1 where i wrot a connection to database in this class to retreive the records.

Now i created a standard exe project where opened a form and want to dispaly the records which iretreived in class2 of the dll

How can i do this can any body help me in this regard.
I want the code and procedure to do this
I hope the Guirus will help me in this regard

Thanking You All
Naveen
Note:The two classes must be in ActiveXDLL of Visual Basic

Paulo Filipe
April 10th, 2001, 04:10 PM
put this code on the function getdb()

set getdb=conn



now when you call the function is called it returns the connection
on the function getRecords add this code

dim gdb as new class1
dim db as adodb.connection
set db=gdb.getdb

gudipallyn
April 10th, 2001, 10:00 PM
Hi friend,

Thankyou for ur code.It has been very useful.
I will be in contact with u for any doubts in my future.

Once again
Thankyou very much