|
-
January 31st, 2000, 12:55 PM
#1
Problem passing a Connection between objects
Hi All,
I'm trying to open an ADODB::Connection in a ActiveX object implemented in VB6 and pass a reference of that connection to another ActiveX object in al differente dll.
I don't know what's going wrong but I have an error when I try to set that connection as a recordset's activeConnection.
Does anyone have any clue about this problem?
Thanks in advance,
Julio
-
January 31st, 2000, 03:46 PM
#2
Re: Problem passing a Connection between objects
I've tryed the same thing, it seems that you can't pass open connections between exe->dll...
you need to open the connection from your dll instead.
-
February 2nd, 2000, 08:43 AM
#3
Re: Problem passing a Connection between objects
That is not exactly the case. You can pass an open connection and use the execute method to create a recordset. The problem with this is that you cannot specify some recodset properties like lockType.
What I don't understand is why you can pass an adodb.connection between objects and use the execute method but you cannot set this connection as the recordset's activeConnection.
Sometimes this is a very importan feature, e.g., when you need to perform some queries within an open transaction.
Regards,
Julio.
-
February 2nd, 2000, 09:37 AM
#4
Re: Problem passing a Connection between objects
The previous post isn't exactly correct either. You cannot use the execute method of a connection or recordset from within a dll - use the recordset's open method to run your queries.
-
February 2nd, 2000, 05:08 PM
#5
Re: Problem passing a Connection between objects
This is the scenario I've tried:
One application creates and open a ADODB.Connection. The same app creates an object implemented in a differente DLL and passes a connection's reference to the new object.
The results I've got are:
1.- I can call execute method and get a recordset (with the limitation I mentioned in a previous message)
2.- When I try to set that connection as the recordset's activeConnection (modifing that property or as the argument of the open method) I get an error.
If anyone has differente results, let me know them to investigate a little further.
Regards,
Julio.
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
|