ADO Recordset Marshaling - strange behavior 
Author Message
 ADO Recordset Marshaling - strange behavior

Does anyone have any ideas about why the following is taking place.

I have created an ActiveX EXE server which supplies data to the Standard EXE
client via disconnected recordsets (ADODB.Recordsets as in-out parameters of
the server methods. I've also tried a function, return type of which is
ADODB.Recordset - same results).

Everything works fine on the same computer, but remotely - not. Remote
objects are created fine, even the methods on those objects which do not
return recordsets execute fine, but when I try to call a method that has a
recordset as one of its parameters, I get automation error: Object does not
support this method. Whereas the same version of the component _locally_
works fine.

I've tried to eliminate all component registration/config. issues by
compiling my project befor the test, then uninstalling the previous version
of the component with clireg32 on both the client and the server, then
installing both server and client again (and configured them for remote
automation with Connection Manager). I checked the CLSID of my component in
Connection Manager on both sides - they are the same. Not to mention that
the recordsets are truly disconnected - ActiveConnection=Nothing,
Client-side cursor, Static.

Both sides have MDAC 2.1 - I installed them manually.
Server classes are MultiUse.

Let me also mention that I am using two Win98 boxes and Remote Automation
for this (i.e. RemAuto Manager is running on the server side).

Maybe there is no such problem with NT and/or DCOM (and/or MTS)? I can't
test this because I don't have any NT boxes at my disposal.

I am puzzled...
If the recordsets get transferred cross-process on the same computer, why
the hell isn't this happening remotely? Remote objects are created fine and
even some methods are executing, only not those that return recordsets.

Does anyone have any ideas? Is there any documentation?

Thanks!



Mon, 17 Dec 2001 03:00:00 GMT
 ADO Recordset Marshaling - strange behavior



Quote:
>Does anyone have any ideas about why the following is taking place.

>I have created an ActiveX EXE server which supplies data to the Standard
>EXE client via disconnected recordsets (ADODB.Recordsets as in-out
>parameters of the server methods. I've also tried a function, return
>type of which is ADODB.Recordset - same results).

>Everything works fine on the same computer, but remotely - not. Remote
>objects are created fine, even the methods on those objects which do not
>return recordsets execute fine, but when I try to call a method that has
>a recordset as one of its parameters, I get automation error: Object
>does not support this method. Whereas the same version of the component
>_locally_ works fine.

[SNIP]

Quote:
>Let me also mention that I am using two Win98 boxes and Remote
>Automation for this (i.e. RemAuto Manager is running on the server
>side).

Two things:

1. Something wrong with how you create the disconnected recordset, i.e.
it's not truly disconnected.

2. You can't do this with Remote Automation (just guessing). Why don't
you use straight DCOM? You can do that with Win98.

Later...

Niels



Mon, 17 Dec 2001 03:00:00 GMT
 ADO Recordset Marshaling - strange behavior
Quote:
> Two things:

> 1. Something wrong with how you create the disconnected recordset, i.e.
> it's not truly disconnected.

It should be. (I forgot to mention that LockType = adLockBatchOptimistic).
Even if it is not disconnected, I should still be able to access the
recordset through its reference like any other object that is passed ByRef,
and not get an "Object does not support this method" error.

Quote:
> 2. You can't do this with Remote Automation (just guessing). Why don't
> you use straight DCOM? You can do that with Win98.

I tried to use "straight DCOM". I had following problems.
In order to use it, Win98 prompts you to switch to User-level access
control. When you do this, it asks for the computer name where the list of
users and groups is located.  I tried to specify each one of the peers - it
lets you switch to user-level in either case. However, after restart, when
you try to add users to the list, it gives an error: Cannot create a user
account (or something alike). Since Win98 won't let create the list (or does
it?), I assume it has to be on an NT box (NT server?).
So, how am I supposed to use DCOM btw two Win98 peers?

I am beginning to believe, too, that for some reason it can't be done with
Remote Automation, even though it is strange, because Remote Automation
should have nothing to do with specific OLE types - it should just marshal
the data back and forth and handle object references (Am I correct?). If an
out-of-process ActiveX object can be created and used locally without any
problems (i.e. it is registered properly), what's the reason the same can't
be done remotely?

When I pass the recordset in a byte array (after being serialized through
PropertyBag), everything works fine. So, I guess, I have to use this
workaround, or bypass DCOM entirely and use Sockets for client-server
communication, which is much better, because there is much less installation
and configuration headaches for the user. I would appreciate if someone
could suggest me a third-party ActiveX component which implements a blocking
method for server access through Windows Sockets, i.e. a method that does
following: accepts a byte array as a parameter (of arbitrary size, up to a
few megabytes), sends it to the server through Windows Sockets, and, after
the server has processed it, receives a return value from the server (also
as a byte array). The method won't return until the entire transaction is
complete. If anyone knows an ActiveX component or control which does that
(I've looked around on the Net - cannot find such thing), I would really
appreciate it (otherwise I'd have to write it myself with VC++, which I hate
to do).

Thanks!



Tue, 18 Dec 2001 03:00:00 GMT
 ADO Recordset Marshaling - strange behavior
See inline



[SNIP]

Quote:

>I tried to use "straight DCOM". I had following problems.
>In order to use it, Win98 prompts you to switch to User-level access
>control. When you do this, it asks for the computer name where the list
>of users and groups is located.  I tried to specify each one of the
>peers - it lets you switch to user-level in either case. However, after
>restart, when you try to add users to the list, it gives an error:
>Cannot create a user account (or something alike). Since Win98 won't let
>create the list (or does it?), I assume it has to be on an NT box (NT
>server?). So, how am I supposed to use DCOM btw two Win98 peers?

If you run DCOMNFIG (or whatever it's called), can't you set the security
to none, just to test?

Quote:

>I am beginning to believe, too, that for some reason it can't be done
>with Remote Automation, even though it is strange, because Remote
>Automation should have nothing to do with specific OLE types - it should
>just marshal the data back and forth and handle object references (Am I
>correct?). If an out-of-process ActiveX object can be created and used
>locally without any problems (i.e. it is registered properly), what's
>the reason the same can't be done remotely?

Well, there is a deifference in marshalling across process boundaries and
across machine boundaries, as you do in this case.

Later...

Niels



Tue, 18 Dec 2001 03:00:00 GMT
 ADO Recordset Marshaling - strange behavior

Quote:
> If you run DCOMNFIG (or whatever it's called), can't you set the security
> to none, just to test?

I don't remember having such an option (it was like a couple of weeks ago
when I tried this). Under user-level control, you need to associate your
component with certain user or group account(s) in order to use it, which
implies creating (or attaching to) a user account list.

Quote:

> Well, there is a deifference in marshalling across process boundaries and
> across machine boundaries, as you do in this case.

OK. (Even though I don't understand, why?)

Thanks!



Fri, 21 Dec 2001 03:00:00 GMT
 ADO Recordset Marshaling - strange behavior
Hi Niels:



Quote:


> Two things:

> 1. Something wrong with how you create the disconnected recordset, i.e.
> it's not truly disconnected.

> 2. You can't do this with Remote Automation (just guessing). Why don't
> you use straight DCOM? You can do that with Win98.

I'm having simmilar problems using DCOM: I only can make to work remote
server components (ActiveX DLL's under MTS control) when their methods
return intrinsic types (ie: integers, strings and so on), but as soon as I
try to move objects (returning recordsets or custom class objects) I get
automation errors or even errors complying being not able to create the
remote object.  Do you have any advise or know why that should be happening
(it doesn't seem to be a bad registration issue)
--
SALUD,
Jess
*******

*******


Fri, 21 Dec 2001 03:00:00 GMT
 ADO Recordset Marshaling - strange behavior
Hi Jesus,


-in.encomix.es>:

Quote:
>Hi Niels:

>I'm having simmilar problems using DCOM: I only can make to work remote
>server components (ActiveX DLL's under MTS control) when their methods
>return intrinsic types (ie: integers, strings and so on), but as soon as
>I try to move objects (returning recordsets or custom class objects) I
>get automation errors or even errors complying being not able to create
>the remote object.  Do you have any advise or know why that should be
>happening (it doesn't seem to be a bad registration issue)
>--

The only real advise I can give is to make sure that you disconnect your
recordset properly before you return it.

Later...

Niels



Sat, 22 Dec 2001 03:00:00 GMT
 ADO Recordset Marshaling - strange behavior
Hi {*filter*}Sky:



Quote:
> Does anyone have any ideas about why the following is taking place.

> I have created an ActiveX EXE server which supplies data to the Standard
EXE
> client via disconnected recordsets (ADODB.Recordsets as in-out parameters
of
> the server methods. I've also tried a function, return type of which is
> ADODB.Recordset - same results).

> Everything works fine on the same computer, but remotely - not. Remote
> objects are created fine, even the methods on those objects which do not
> return recordsets execute fine, but when I try to call a method that has a
> recordset as one of its parameters, I get automation error: Object does
not
> support this method. Whereas the same version of the component _locally_
> works fine.

Having more or less the same problem: remote connection was OK, as it showed
using methods returning implicit data types (integer, string, and so on),
but when going to returning recordsets I was stuck with errors like this
method doesn't exist or unable to create the ActiveX object.  During the
debugging process I found two things:
FIRST: There is a bug in the VB6 ClassWizard.  You shouldn't use the
Properties/Attribs entry to coment your classes since they won't register as
automation servers (although there won't be any error) as I discovered thru
OLE Viewer.
SECOND: I had errors not only with recordsets but with any method which
returned objects (not only recordsets).  I where more or less through the
same steps as you (using DCOM config, clireg, and so on).  The only
difference seems to be that I use MTS in the server side.

Well, now the solution: I did the trick using the VB package and
distribution wizard and the exporting package option of MTS.  First I run
the client packet created by MTS (wich registers the server component TLB in
the client machine) and, after that, running the setup program generated by
the VB package and distribution wizard.  Still, when creating the client
package I had to run it first with the DLL project in order to create the
DEP file which seemed to need the client app to be aware of the server side
component (although I think my MTS created package should be enough since it
will register the server TLB with the client machine as it's said).  Well,
may be you can find your way with this adverti{*filter*}t.  Anyway, hope it
helps.
--
SALUD,
Jess
*******

*******



Sat, 22 Dec 2001 03:00:00 GMT
 ADO Recordset Marshaling - strange behavior

Quote:

> Having more or less the same problem: remote connection was OK, as it
showed
> using methods returning implicit data types (integer, string, and so on),
> but when going to returning recordsets I was stuck with errors like this
> method doesn't exist or unable to create the ActiveX object.  During the
> debugging process I found two things:
> FIRST: There is a bug in the VB6 ClassWizard.  You shouldn't use the
> Properties/Attribs entry to coment your classes since they won't register
as
> automation servers (although there won't be any error) as I discovered
thru
> OLE Viewer.

I didn't use ClassWizard - I created my classes "manually".

Quote:
> SECOND: I had errors not only with recordsets but with any method which
> returned objects (not only recordsets).

(I haven't tried other objects.)

Quote:

> Well, now the solution: I did the trick using the VB package and
> distribution wizard and the exporting package option of MTS.

I used Package and Deployment Wizard as well for my server component. It
registers the component fine, but I still can't pass recordsets. (I have not
tried MTS since I don't have NT).

Take care...



Sun, 23 Dec 2001 03:00:00 GMT
 ADO Recordset Marshaling - strange behavior
On Thu, 1 Jul 1999 19:47:38 -0700, "{*filter*}Sky"

Quote:

>Does anyone have any ideas about why the following is taking place.

>I have created an ActiveX EXE server which supplies data to the Standard EXE
>client via disconnected recordsets (ADODB.Recordsets as in-out parameters of
>the server methods. I've also tried a function, return type of which is
>ADODB.Recordset - same results).

<snip>
This isn't really a "solution", but have you considered using the
GetRows method of ADO recordset to return a variant array rather than
a disconnected recordset?  

I prefer this method as it allows my business objects to not have to
be dependent on ADO or any specific method of data access...

Wade



Fri, 28 Dec 2001 03:00:00 GMT
 ADO Recordset Marshaling - strange behavior
Quote:

> Hi {*filter*}Sky:



> > Does anyone have any ideas about why the following is taking place.
...
> > client via disconnected recordsets (ADODB.Recordsets as in-out parameters
> of
> > the server methods. I've also tried a function, return type of which is
> > ADODB.Recordset - same results).
...

> Having more or less the same problem: remote connection was OK, as it showed
> using methods returning implicit data types (integer, string, and so on),
> but when going to returning recordsets I was stuck with errors like this
> method doesn't exist or unable to create the ActiveX object.  

...

This is perhaps a silly, but could it be that ADO (or a wrong version)
of ADO
is instaleld on the server? What do you use as reference in you client-
app? Do you reference to the tlb or the exe? Possibly this could be an
errorsource too.
Hmm, what common troublemakers have we else: Server compiled without
binary-compat., ADO not registered correctly, Proxy/Stub-dll not
registered ...

Thats about everything I can say. It's not much and not very specific,
but at least it _could_ be some help.

jens



Fri, 28 Dec 2001 03:00:00 GMT
 ADO Recordset Marshaling - strange behavior
Your assumption may not be right with his problem, but over the weekend we
ran into the same problem.  The solution was to upgrade to MDAC 2.1.  We
were trying to send a dicsonnected recordset to an ASP page through a ATL
COM object.  It worked on development machines, but not on production.  I
guess we will not trust the Admin when he tells us, "sure I upgraded
MDAC....."

Bob


Quote:

> > Hi {*filter*}Sky:


noticias

> > > Does anyone have any ideas about why the following is taking place.
> ...
> > > client via disconnected recordsets (ADODB.Recordsets as in-out
parameters
> > of
> > > the server methods. I've also tried a function, return type of which
is
> > > ADODB.Recordset - same results).
> ...

> > Having more or less the same problem: remote connection was OK, as it
showed
> > using methods returning implicit data types (integer, string, and so
on),
> > but when going to returning recordsets I was stuck with errors like this
> > method doesn't exist or unable to create the ActiveX object.
> ...

> This is perhaps a silly, but could it be that ADO (or a wrong version)
> of ADO
> is instaleld on the server? What do you use as reference in you client-
> app? Do you reference to the tlb or the exe? Possibly this could be an
> errorsource too.
> Hmm, what common troublemakers have we else: Server compiled without
> binary-compat., ADO not registered correctly, Proxy/Stub-dll not
> registered ...

> Thats about everything I can say. It's not much and not very specific,
> but at least it _could_ be some help.

> jens



Fri, 28 Dec 2001 03:00:00 GMT
 
 [ 12 post ] 

 Relevant Pages 

1. ADO Recordset Marshaling - strange behavior

2. ADO Recordset, strange behavior of Memo field

3. ADO Recordset Marshaling by Value or Ref

4. Strange behavior of recordset FieldChangeComplete Event - a bug?

5. Strange behavior of ADODB.Recordset.Save method (to XML)

6. Strange behavior on multiple primary key behavior d

7. Strange behavior on multiple primary key behavior

8. Strange behavior on multiple primary key behavior deleting childr

9. Strange Behavior - ADO and SQL Server 6.5

10. Strange behavior with SQL 6.5 and ADO/RDS

11. Strange ADO Behavior (E_FAIL)

12. Strange ADO Connection Behavior


 
Powered by phpBB® Forum Software