Click here to Skip to main content
15,903,175 members
Home / Discussions / COM
   

COM

 
GeneralIRunnableTask and IExtractImage Pin
ohadp18-Dec-03 1:45
ohadp18-Dec-03 1:45 
GeneralHelp me for COM+ design with C#.NET Pin
Simi Agarwal17-Dec-03 21:37
Simi Agarwal17-Dec-03 21:37 
QuestionHow to capture mouse event in MS word? Pin
aw1ay17-Dec-03 15:55
aw1ay17-Dec-03 15:55 
GeneralMS Active Accessibility problem Pin
visharma17-Dec-03 10:52
visharma17-Dec-03 10:52 
GeneralCreating WorksheetFunctions for Excel Office XP Pin
ThOmAs2217-Dec-03 8:23
ThOmAs2217-Dec-03 8:23 
GeneralAccess IDispatch from C Pin
Spiros17-Dec-03 2:45
Spiros17-Dec-03 2:45 
GeneralRe: Access IDispatch from C Pin
Jörgen Sigvardsson22-Dec-03 14:08
Jörgen Sigvardsson22-Dec-03 14:08 
GeneralUsing Recordset in .NET created by COM object Pin
rivimey17-Dec-03 1:48
rivimey17-Dec-03 1:48 
Hi, I'm new to COM and .NET, and this is a fairly advanced question. So please be kind Smile | :)

I have an application written in VB6 that does some database stuff. There isn't time, yet, to rewrite it all in .NET. So we are hoping to rewrite the UI in .net and use the data manipulation core via COM interop. We have been trying to use the EXE file as the COM server, rather than expose a DLL. VS.NET 2003 has imported the exe file happily and we can call some simple functions fine.

However, the COM server uses ADODB and, in particular, it is necessary to read from ADO recorsdets created in the COM code and display them in a .NET datagrid. I understand the thing to do is use the OleDbDataAdapter. When I try this, I get a runtime error:

Except: Object is not an ADODB.Recordset or an ADODB.Record.
Parameter name: adodb
Specified cast is not valid.
at System.Data.OleDb.OleDbDataAdapter.FillFromADODB(Object data, Object adodb, String srcTable, Boolean multipleResults)
at System.Data.OleDb.OleDbDataAdapter.Fill(DataSet dataSet, Object ADODBRecordSet, String srcTable)
at MyApp.Main.SetDataFolder(String DocFolder, String withFilter) in Main.vb:line 1303

I don't understand why!

I have tried using both the ActiveX and the PIA ADODB references, and have tried using the various ADODB types for recordset (there are 3 - Recordset, RecordsetClass and _Recordset); nothing helps. The only thing that did help was creating the RS within .NET land, which worked fine but doesn't help us.

The relevant code is:
Dim FolderRecordSet As ADODB.Recordset
...
FolderRecordSet = EFClient.GTCodingUpdate.FolderRS
Dim ds As DataSet = New DataSet
Try
DocumentDataAdapter.Fill(ds, FolderRecordSet, "Documents")
DataGrid.SetDataBinding(ds, "Documents")

Catch e As OleDb.OleDbException
MsgBox("OleDb: " & e.Message & vbCrLf & e.InnerException.Message & vbCrLf & e.StackTrace)
Catch e As Exception
MsgBox("Except: " & e.Message & vbCrLf & e.InnerException.Message & vbCrLf & e.StackTrace)
End Try
Cry | :((
Questionany body knowing menu merging? Pin
safee ullah15-Dec-03 19:43
safee ullah15-Dec-03 19:43 
Generalverbs and shared menus in Active x Control Pin
safee ullah15-Dec-03 19:24
safee ullah15-Dec-03 19:24 
General.Net control in ActiveX host, accelerators/tabbing not working Pin
thedex15-Dec-03 3:17
thedex15-Dec-03 3:17 
GeneralOutlook Events Pin
derzellner15-Dec-03 0:08
derzellner15-Dec-03 0:08 
Generalcannot register automatic a COM into Components Services Pin
alinilie14-Dec-03 10:54
alinilie14-Dec-03 10:54 
GeneralSending Events from a DLL Pin
Sid_smily12-Dec-03 7:21
Sid_smily12-Dec-03 7:21 
GeneralRe: Sending Events from a DLL Pin
Abhishek Srivastava12-Dec-03 22:21
Abhishek Srivastava12-Dec-03 22:21 
GeneralCOM/DCOM without ATL Pin
Kene12-Dec-03 3:40
Kene12-Dec-03 3:40 
GeneralRe: COM/DCOM without ATL Pin
valikac13-Dec-03 5:34
valikac13-Dec-03 5:34 
GeneralTo COM or not to COM, that is the question ! Pin
Paul Silvernail11-Dec-03 2:14
Paul Silvernail11-Dec-03 2:14 
GeneralRe: To COM or not to COM, that is the question ! Pin
Heath Stewart11-Dec-03 12:21
protectorHeath Stewart11-Dec-03 12:21 
GeneralHandling events with COM object as param Pin
NotProfessional10-Dec-03 8:51
NotProfessional10-Dec-03 8:51 
GeneralRe: Handling events with COM object as param Pin
Abhishek Srivastava10-Dec-03 21:40
Abhishek Srivastava10-Dec-03 21:40 
GeneralRe: Handling events with COM object as param Pin
Steve S11-Dec-03 5:37
Steve S11-Dec-03 5:37 
GeneralRe: Handling events with COM object as param Pin
NotProfessional11-Dec-03 9:42
NotProfessional11-Dec-03 9:42 
GeneralRe: Handling events with COM object as param Pin
NotProfessional11-Dec-03 10:27
NotProfessional11-Dec-03 10:27 
GeneralRe: Handling events with COM object as param Pin
Vi211-Dec-03 2:54
Vi211-Dec-03 2:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.