|
-
April 4th, 2001, 11:15 PM
#1
Database Programming using DLL
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
-
April 10th, 2001, 04:10 PM
#2
Re: Database Programming using DLL
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
-
April 10th, 2001, 10:00 PM
#3
Re: Database Programming using DLL
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|