.NET Framework Bookmark and Share   
 index > .NET Base Class Library > Runtime Error 430 in VBA code
 

Runtime Error 430 in VBA code

Hello friends,

I created a .net library(DataRet.dll) which retrieves data from a Oracle table.I am calling this library from my access application. Thefunction which i am calling returns a recordset.Code mentioned below.

1. Dimda As New DataRet.RetSet
2. Dim rst As New ADODB.Recordset

3. Set rst = da.getList() //getList() returns the record set
4. Text4.Text = rst.RecordCount
5. rst.Close

The error is at line 3
Runtime Error: 403 class does not support automation or does not support expected interface
Can anyone tell me the reasons for this error.

SubbuShines
Hi,

This error means that your methods from class are not visible for COM (not exposed in interface).
First check attributes on your class DataRet.RetSet
You should have something similar to code below:

[Guid("AE79DA87-B7D0-4f2f-9A2F-C3E50D27949E"),
ClassInterface(ClassInterfaceType.AutoDispatch),
ComVisible(true)]

class RetSet
.......

Then make sure that you really have method getList insid with public visibility.

You can also use ClassInterfaceType.None and inherit your class from interface, then result will be the same.
For more details refer to those attributes reference.

Greets

smart_obelix
Hi...

Thanks for your response...

I have something like this

[

ClassInterface(ClassInterfaceType.AutoDual), ComVisible(true)]

public

class RetSet

......



and yes i do have getList method which is public...

Can u explain a bit more as i am new to all these...

Thank u

SubbuShines
Hi,

I just noticed that you want to get ADODB.Recordset as an result.
What type are you returning from C#?
Because .NET types are incompatible with VB6 types.

Please show me also declaration of method getList (parameters and return type) - I think there is key to your problem.

Greets
smart_obelix

Hi,

Ya i want to get ADODB.Recordset as result.
From c# i am returning ADODB.Recordset itself..

publicRecordset getList()

{

LoadData();

return ComUtility.ComUtility.ConvertToRecordSet(dt);
}

The above function returns the recordset(ADODB).

ConvertToRecordSet() does the conversion of a data table to recordset.

The above code is test passsed but am not clear why is that error 430 troubles me.


Thanks
SubbuShines

You can use google to search for other answers

Custom Search

More Threads

• how to check for a certain process if it is running
• FAQ: How do I convert a long path to a short path?
• Using SerialPort class with win32 com handle coming from TAPI
• how to get the correct buffer manager
• Strange Chaeacter after delete TAB
• generic typenames in app.config
• How to write dllhost.exe.config during deployment
• How to cast object to generic interface?
• Decompress file compressed via Compress.exe
• Get Ressources of a referenced assembly