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

Failed getting rowset(s) from Activex exe

Status
Not open for further replies.

GlynA

Programmer
May 1, 2002
77
GB
I have an application which includes a data report which is dynamically bound to a data source. When this data source is a record set returned by an ActiveX DLL the application works OK, but when I change the DLL into an ActiveX exe I get an error 8577 "Failed getting rowset(s) from data source". The code in the dll and the exe is identical.
Can anyone suggest why I am getting the error and a workround to avoid it.
 
Hi GlynA,

if your code is in a DLL then the EXE and DLL resists in
the same Process, so you can access memory from the DLL in
the EXE and vice versa.

if your code is in an ActiveX Exe, the code runs in a
seperate Process.

if've done it in one of my projects doing these steps:

1. Create the ActiveX Exe object
2. Set the Connectionstring
3. Create a new Connection in the ActiveX Exe object
4. Perform the query
5. The result record set has to be returned "byval"

Example:

' Method of the ActiveX Exe object
Public Sub GetData(ConStr As String, QryStr As String, ByVal Result As Recordset)
Dim objCon As Connection
Dim objRS as Recordset

' Create Connection
' ...
' Create Recordset
' ...
' Query data
' ...
' Return result
Set Result = objRS
End Sub

bye
LauDse
 
Hi LauDze,

The exe (or DLL) passes back the record set as the return value of a function. The main application then sets a variable to this return value. This seems to be all OK as I am able to view data in the recordset and navigate through it using the Immediate window in debug mode. It is only when I try and view the report (after assigning the recordset to it) that the error occurs. Have you assigned your recordset in this way?

I am a little confused by your comment about returning the recordset ByValue since use of ByValue usually indicates that the passed value cannot be modified!

Glyn.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top