Jump to content
Devon

MSDATASRC... doesn't work in code!

Recommended Posts

This is converted code from a project.  It is a basic combo box loading routine.  

The cbo.RowSource is an MSDATASRC an the rst is the created / converted ADORecordSetHelper.

They aren't compatible!  Okay so what can I assign in code to make this work?

image.thumb.png.0aa56f385137a73c11a1fd15f2b25d0c.png

Share this post


Link to post
Share on other sites

Hi Devon,

the cbo is a Activex Combobox, so it's not a .Net control. Because of that, the RowSource property cannot be assigned to a .Net class. At this point there are two alternatives:

1. Change the AxDataCombo by a .Net control. In that case it would be compatible with other .Net classes/components. This have to be done in a manual fashion as currently the VBUC does not automatically convert that control to a .Net one.

2. Migrate the vb6 code using ADODB via Com Interop (see attached file). By doing this, all classic adodb code willnot be converted to ADO.Net, so the cbo.RowSource and the rst object may be compatible.

However, as you're converting your code to .Net my suggestion would be the option 1.

 

Regards,

 

OlmanQ

 

adodb.png

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Terms of Use