Recordset - Object Required

R

rob

Dear All,

I have a COM+ component that returns an ADODB.Recordset. In an include file
that is included by an aspx page I assign that returned recorset to an
ADODB._Recordset. Unfortunately, this assignment breaks and after many days
I still couldn't figure out why. Therefore, any help is highly appreciated.
Note that the aspx pages were automatically converted by the MS/Artisan "ASP
to ASP.NET migration tool" which is only one small step in our full
migration path.

Here is a code snipet:

COM+ component (busData):
------------------------------
Public Function GetRecord(ByVal psItem As String) As ADODB.Recordset
Dim odbData As dbData.Data

Set odbData = GetObjectContext.CreateInstance("dbData.Data")
Set GetRecord = odbData.GetRecord(psItem) <-- VALID DATA IS RETURNED
(TESTED)
GetObjectContext.SetComplete
Set odbClient = Nothing
End Function

Include to aspx page:
---------------------
function aspGetData()
Dim oData As busData.Data
Dim oRS As ADODB._Recordset

Set oData = Server.CreateObject("busData.Data")
Set oRS = oClient.GetRecord(GsItem) <-- THIS BREAKS
end function


The COM+ component works fine and does retrieve a valid dataset. Replacing
"Set oRS = oClient.GetRecord(GsItem)" with "oClient.GetRecord(GsItem)" works
fine, too. So the problem really is with the assignment. Changing
"ADODB._Recordset" to "ADODB.Recordset" does not help either.

The exact error is:
------------------
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Runtime.InteropServices.COMException: Object
required

I use Microsoft .NET Framework Version:1.1

Regards,

Rob
 
G

Guest

Have you tried to Initialize the RecordSet usin

oRS = New ADODB.Recordse

Regards

Trevor Benedict
MCSD
 
R

rob

Trevor,

Yes, I have already tried that. Again, with both ADODB._Recordset and
ADODB.Recordset.

Rob
 
T

Trevor Benedict R

Another alernate thing that you could do to test this would be to create
a sample VB DLL to return a RecordSet and use the same reference in .NET
to test it out.

Sorry for not being of mych help. I tried to create a sample but it
works on my machine.

Regards,

Trevor Benedict R
MCSD

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
 
R

rob

Trevor,

Thanks a lot for your reply. I have created a VB project and tired to use it
in my aspx page but without success. You mentioned that you have written a
sample. In case you still have it could you send it to me. If it does not
work for me then there is probably a problem with my system. Otherwise I can
go from your example.

Thanks,
Rob
 
T

Trevor Benedict R

I would be pleased to help you with a sample. Do drop an email to me at
(e-mail address removed) if you so require.

PS: I do not have a sample at present. I will just write a simple one
for you.

Regards,

Trevor Benedict R
MCSD

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
 
T

Trevor Benedict R

Hi,
Have you tested the sample that I sent. Any feedback on this issue. Have
you sorted it out.

Trevor Benedict R
MCSD

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top