PC Review


Reply
Thread Tools Rate Thread

C# and ADO RecordSet

 
 
Gilgamesh
Guest
Posts: n/a
 
      12th Nov 2007
How do I pass a result of a stored procedure from a C# assembly to a VB 6 so
VB can see the result as RecordSet?

Thanks,
Gilgamesh


 
Reply With Quote
 
 
 
 
Marc Gravell
Guest
Posts: n/a
 
      12th Nov 2007
<shudder> - but perhaps try this? No warranty, though...

http://www.codeproject.com/cs/databa...oRecordset.asp

Marc

 
Reply With Quote
 
Nicholas Paldino [.NET/C# MVP]
Guest
Posts: n/a
 
      12th Nov 2007
Gilgamesh,

The best way to do it would be to access the data through ADO (not
ADO.NET) through COM interop in .NET, and then pass the recordset along to
VB.


--
- Nicholas Paldino [.NET/C# MVP]
- (E-Mail Removed)

"Gilgamesh" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> How do I pass a result of a stored procedure from a C# assembly to a VB 6
> so VB can see the result as RecordSet?
>
> Thanks,
> Gilgamesh
>



 
Reply With Quote
 
Marc Gravell
Guest
Posts: n/a
 
      12th Nov 2007
Of course, you could also serialize to disk as csv and read from
there... depending on the data volume it might be quicker (less
interop). Of course, then you just need to get the export and import
working...

Perhaps the VB6 could just run the stored procedure itself? ;-p

Marc

 
Reply With Quote
 
Marc Gravell
Guest
Posts: n/a
 
      12th Nov 2007
d'oh! yes - exec the proc in legacy ADO via C#. I feel so dirty
touching ADO with C# that it didn't even occur. Good catch.

 
Reply With Quote
 
Gilgamesh
Guest
Posts: n/a
 
      12th Nov 2007
That's what I'm doing. Thanks for your help.
-G


"Nicholas Paldino [.NET/C# MVP]" <(E-Mail Removed)> wrote in
message news:(E-Mail Removed)...
> Gilgamesh,
>
> The best way to do it would be to access the data through ADO (not
> ADO.NET) through COM interop in .NET, and then pass the recordset along to
> VB.
>
>
> --
> - Nicholas Paldino [.NET/C# MVP]
> - (E-Mail Removed)
>
> "Gilgamesh" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> How do I pass a result of a stored procedure from a C# assembly to a VB 6
>> so VB can see the result as RecordSet?
>>
>> Thanks,
>> Gilgamesh
>>

>
>



 
Reply With Quote
 
Gilgamesh
Guest
Posts: n/a
 
      12th Nov 2007
I'm using the following code to run a stored procedure which doesn't need a
parameter:

Recordset _recordSet = _adoCommand.Execute(out _dummy1, ref _dummy2,
(int)ExecuteOptionEnum.adExecuteRecord);

The above code throws this error: Parameter object is improperly defined.
Inconsistent or incomplete information was provided. at
ADODB.CommandClass.Execute(Object& RecordsAffected, Object& Parameters,
Int32 Options)

Any idea why the command object doesn't understand that no parameters are
needed?

-G

"Nicholas Paldino [.NET/C# MVP]" <(E-Mail Removed)> wrote in
message news:(E-Mail Removed)...
> Gilgamesh,
>
> The best way to do it would be to access the data through ADO (not
> ADO.NET) through COM interop in .NET, and then pass the recordset along to
> VB.
>
>
> --
> - Nicholas Paldino [.NET/C# MVP]
> - (E-Mail Removed)
>
> "Gilgamesh" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> How do I pass a result of a stored procedure from a C# assembly to a VB 6
>> so VB can see the result as RecordSet?
>>
>> Thanks,
>> Gilgamesh
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Binding a form to a disconnected recordset and making it capable to update such recordset Yarik Microsoft Access 2 22nd Nov 2006 02:18 AM
Binding a form to a disconnected recordset and making it capable to update such recordset Yarik Microsoft Access Form Coding 2 22nd Nov 2006 02:18 AM
Access 2002: bind adodb recordset to listbox recordset property Craig Buchanan Microsoft Access Form Coding 2 1st May 2005 12:14 AM
How to loop through a recordset and update the field of a recordset or delete current record Karen Middleton Microsoft Access Macros 1 4th Jan 2005 10:30 AM
How to loop through a recordset and update the field of a recordset or delete current record Karen Middleton Microsoft Access Queries 1 4th Jan 2005 10:30 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:49 PM.