Results 1 to 15 of 15

Thread: [RESOLVED] loaded program from vs2008 to vs2022 and have ADODB major error InnerException

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2024
    Posts
    517

    Resolved [RESOLVED] loaded program from vs2008 to vs2022 and have ADODB major error InnerException

    Basically, I don't understand what the solution would be.
    What is VS 2022 saying here?


    It needed a reference for ADODB, I first tried 2.8 but no work, tried 2.7, get same error.

    An error occurred creating the form. See Exception.InnerException for details. The error is: Could not load file or assembly 'Interop.ADODB, Version=2.7.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
    Attached Images Attached Images  

  2. #2
    PowerPoster PlausiblyDamp's Avatar
    Join Date
    Dec 2016
    Location
    Pontypool, Wales
    Posts
    2,546

    Re: loaded program from vs2008 to vs2022 and have ADODB major error InnerException

    That sounds like a miss-match between .net versions. What version of .Net are you using for this project? It might be worth removing the ADODB references, seeing if there are any related interop assemblies in your bin / obj folders and deleting them (it might be worth just deleting the bin and obj folders anyway). Then try adding the reference back and see if that fixes anything.

    Regardless of this error, if you are moving from VB6 to .Net you probably want to move away from ADODB anyway - .net has it's own data access methods and it would make a lot more sense to use one of the .net methods going forward anyway.

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2024
    Posts
    517

    Re: loaded program from vs2008 to vs2022 and have ADODB major error InnerException

    Quote Originally Posted by PlausiblyDamp View Post
    That sounds like a miss-match between .net versions. What version of .Net are you using for this project? It might be worth removing the ADODB references, seeing if there are any related interop assemblies in your bin / obj folders and deleting them (it might be worth just deleting the bin and obj folders anyway). Then try adding the reference back and see if that fixes anything.

    Regardless of this error, if you are moving from VB6 to .Net you probably want to move away from ADODB anyway - .net has it's own data access methods and it would make a lot more sense to use one of the .net methods going forward anyway.
    vs2008 is .net 3.5
    When I first tried the program in vs2022, I got tons of errors, could not load the forms designer for any forms,
    so I thought to add .net 3.5. Downloaded and installed, then all the forms were visible in vs 2022.
    Tried to run program, but had no definitions for the adodb. So I thought to add it as a reference.
    So that is where I am at for the moment.

    SO I will try deleting bin obj folders.

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2024
    Posts
    517

    Re: loaded program from vs2008 to vs2022 and have ADODB major error InnerException

    deleted and same issue remains
    I am actually able to make more progress using vs2008.
    at least it runs in 2008!

    Any solutions, whole thing seems sketch to me.
    Is it saying it cannot load as some kind of version mismatch but it does not give enough details to know what to do for my limited understanding.

    I assume I actually have adodb on this laptop as the program uses adodb 2.8 in vb6 and it runs fine.
    Attached Images Attached Images  

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2024
    Posts
    517

    Re: loaded program from vs2008 to vs2022 and have ADODB major error InnerException

    pic of the migration report from vs2008 , it looked good at that point
    but they were not being very good about the migration as it cannot run in vs2022
    Attached Images Attached Images  

  6. #6
    PowerPoster PlausiblyDamp's Avatar
    Join Date
    Dec 2016
    Location
    Pontypool, Wales
    Posts
    2,546

    Re: loaded program from vs2008 to vs2022 and have ADODB major error InnerException

    I am wondering if the vs2008 migration has generated interop libraries based on a different version of dotnet than the one vs2022 is using.

    Honestly not sure what the solution to this might be. Then again I works move away from ADODB as soon as possible if I was using dotnet.

  7. #7

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2024
    Posts
    517

    Re: loaded program from vs2008 to vs2022 and have ADODB major error InnerException

    better pics, for some reason showing pics directly has terrible resolution
    https://photos.app.goo.gl/WL1Ni74Ye4xuMcTEA

    https://photos.app.goo.gl/qor2NK1NRYriyzmK8

    I can always try again.
    AND WHY did vs2022 NOT see the already selected ADODB reference in the vs2008 project, the import into vs2022 simply left it out.
    SO not very impressed with vs2022 import conversion process from vs2008

  8. #8

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2024
    Posts
    517

    Re: loaded program from vs2008 to vs2022 and have ADODB major error InnerException

    Quote Originally Posted by PlausiblyDamp View Post
    I am wondering if the vs2008 migration has generated interop libraries based on a different version of dotnet than the one vs2022 is using.

    Honestly not sure what the solution to this might be. Then again I works move away from ADODB as soon as possible if I was using dotnet.
    Well for this program, I don't see a good reason to change from ADODB, the databases are small enough, not dealing with millions of records. The little I saw of ADO.Net is it uses disconnected recordsets to lower the burden on a database server. Other thing is not many users will be hitting the server with my program. It just will never happen. I am able to easily search in less than 1 second thru 1500,000 records on 15 tables and get information.

  9. #9

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2024
    Posts
    517

    Re: loaded program from vs2008 to vs2022 and have ADODB major error InnerException

    Secret Translation of the issue according to MS. We do not want you using ADODB anymore. We have been warning about this since VS2008.
    So we will cryptically make it difficult for you to use ADODB from now on.

    I should make a little test program using ADODB reference and see if it even works at all in vs2022.

    You know MS and their tools, they want it done their way. Why do you suppose other ways have gained so much market traction regarding things like web servers, PHP, Apache, Linux, Android, etc... Maybe people don't want to be forcible steered MS's way into their channels.
    Last edited by sdowney1; Apr 21st, 2024 at 01:49 PM.

  10. #10

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2024
    Posts
    517

    Re: loaded program from vs2008 to vs2022 and have ADODB major error InnerException

    Quote Originally Posted by PlausiblyDamp View Post
    I am wondering if the vs2008 migration has generated interop libraries based on a different version of dotnet than the one vs2022 is using.

    Honestly not sure what the solution to this might be. Then again I works move away from ADODB as soon as possible if I was using dotnet.
    There may not be a solution.

    Well, don't know how hard that would be to do. I am actually not needing to do anything, I am just doing this for fun and learning. I would like to eventually have the program working with unicode, which really is the whole idea for me and vbnet versus vb6.
    One reason ADO worked well for me was I usually did not build huge recordsets on the local machine. And we are not talking millions of rows either.

    I used temporary tables built on the database server, linked ID primary keys in those tables. So a table of keys, table has it's own primary key ID number, and it has one column of Id numbers of the rows in the main tables of the databases. So just 2 columns of numbers. And I also made an index of those table names in another table to get info from rows. I also saved the searches as long as the DB table did not change, the earlier searches did not need to be done over again. Of course as PC got much more powerful over the last 25 years, that is less of an issue than it was 25 years ago.

  11. #11
    PowerPoster PlausiblyDamp's Avatar
    Join Date
    Dec 2016
    Location
    Pontypool, Wales
    Posts
    2,546

    Re: loaded program from vs2008 to vs2022 and have ADODB major error InnerException

    Quote Originally Posted by sdowney1 View Post
    Secret Translation of the issue according to MS. We do not want you using ADODB anymore. We have been warning about this since VS2008.
    So we will cryptically make it difficult for you to use ADODB from now on.

    I should make a little test program using ADODB reference and see if it even works at all in vs2022.

    You know MS and their tools, they want it done their way. Why do you suppose other ways have gained so much market traction regarding things like web servers, PHP, Apache, Linux, Android, etc... Maybe people don't want to be forcible steered MS's way into their channels.
    I just created a new console app in vs 2022, added a COM Reference to Microsoft.ActiveX Data Objects 2.8 Library and tried to create a Recordset and query some data - everything worked fine. Not sure if there is a difference in creating a project from scratch, or upgrading an earlier project, but there were no issues here.

  12. #12

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2024
    Posts
    517

    Re: loaded program from vs2008 to vs2022 and have ADODB major error InnerException

    Quote Originally Posted by PlausiblyDamp View Post
    I just created a new console app in vs 2022, added a COM Reference to Microsoft.ActiveX Data Objects 2.8 Library and tried to create a Recordset and query some data - everything worked fine. Not sure if there is a difference in creating a project from scratch, or upgrading an earlier project, but there were no issues here.
    Nice to hear that, must be some hope to figure it out.
    Right now, it is beyond me.
    I don't get how it can work in vs2008 and not work in vs2022

    There could possibly be some single code line in a config file causing the screwup.
    It is just too cryptic for me to know what to do.

    What if I installed vs2015 and upgrade project, then upgraded in vs2022?
    Where will the process break?

  13. #13

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2024
    Posts
    517

    Re: loaded program from vs2008 to vs2022 and have ADODB major error InnerException

    Quote Originally Posted by PlausiblyDamp View Post
    I just created a new console app in vs 2022, added a COM Reference to Microsoft.ActiveX Data Objects 2.8 Library and tried to create a Recordset and query some data - everything worked fine. Not sure if there is a difference in creating a project from scratch, or upgrading an earlier project, but there were no issues here.
    the fix I think is in this link, your right about net frameworks.

    But can anyone tell me what to do to change my app config to use the right framework?

    https://stackoverflow.com/questions/...ed-runtime-and
    possibly the fix is in the above discussion. Can someone tell me how exactly to make this change?

  14. #14
    PowerPoster PlausiblyDamp's Avatar
    Join Date
    Dec 2016
    Location
    Pontypool, Wales
    Posts
    2,546

    Re: loaded program from vs2008 to vs2022 and have ADODB major error InnerException

    Quote Originally Posted by sdowney1 View Post
    the fix I think is in this link, your right about net frameworks.

    But can anyone tell me what to do to change my app config to use the right framework?

    https://stackoverflow.com/questions/...ed-runtime-and
    possibly the fix is in the above discussion. Can someone tell me how exactly to make this change?
    You should be able to choose the framework version from the project properties. Shouldn't need to mess around in the config files.

  15. #15

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2024
    Posts
    517

    Re: loaded program from vs2008 to vs2022 and have ADODB major error InnerException

    ok, I solved it. Followed these instructions from the link

    You'll either have to upgrade the .NET 2 project to .NET 4, or downgrade the .NET 4 project to .NET 3.5 (or earlier).

    How do you upgrade the .net version? I am not sure where to and what to specify. Please help.

    Edit: I found the answer myself. Select the project, right click and choose Property Pages. There you can select framework version. or select the project and click Shift+F4


    Right click project file upper right side of vs2022 screen
    Changed net framework from 3.5 to 4.8

    Program now runs!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width