Record Set question

V

vbmark

I am calling a Visual Basic 6 DLL to that returns a Record Set.

Here is my code in my VB.NET program.

Dim objRS

objRS = oMyObject.ReturnRecordSet()

If Not objRS Is Nothing Then
Do While Not objRS.EOF
sw.WriteLine(objRS("UserID"))
sw.WriteLine(objRS("UserName"))
objRS.MoveNext()
Loop
End If


What happens is objRS just returns System.__ComObject.

How do I get this to work? That is, to get the returned Record Set and
then be able to enumerate through the records.
 
K

Ken Tucker [MVP]

Hi,

Stop using late binding.

Dim objRS as RecordSet

Ken
---------------------
I am calling a Visual Basic 6 DLL to that returns a Record Set.

Here is my code in my VB.NET program.

Dim objRS

objRS = oMyObject.ReturnRecordSet()

If Not objRS Is Nothing Then
Do While Not objRS.EOF
sw.WriteLine(objRS("UserID"))
sw.WriteLine(objRS("UserName"))
objRS.MoveNext()
Loop
End If


What happens is objRS just returns System.__ComObject.

How do I get this to work? That is, to get the returned Record Set and
then be able to enumerate through the records.
 
C

Cor Ligthert

vbmark,

Probably is the solutioon, what when you don't give late binding

Dim objRS as RecordSet

I hope this helps,

Cor
 

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

Top