locked
Could not load file or assembly 'Interop.ADOX, Version=6.0.0.0 RRS feed

  • Question

  • I have a long time project VB1 -  VB2010. Now upgraded to VB2019

    Most things seems to be working fine but creating a new database will not work.
    Code working in VB2010:

    cat.Create("Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & Dbase & ";" & "Locale Identifier=1053;" & "Jet OLEDB:Engine Type=5")

    But now the program can't get there because:
    "Could not load file or assembly 'Interop.ADOX, Version=6.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified."

    I do not know what to do, I need help. Help!


    Appleforce

    Thursday, May 14, 2020 1:14 PM

Answers

  • I Guess the right thing to do is to use 

    DBEngine.CreateDatabase(Dbase, dbLangSwedFin, dbVersion30)

    (and DBEngine.Compactdatabase(DBase, DBase_2) to compact)

    Now remains to find out how these functions are working, what need to be defined and so on.


    Appleforce


    • Edited by appleforce Friday, May 15, 2020 8:38 AM
    • Marked as answer by appleforce Thursday, May 21, 2020 10:03 AM
    Friday, May 15, 2020 8:27 AM
  • Hi,
    please check or include reference for ADOX:


    --
    Best Regards / Viele Grüße
    Peter Fleischer (former MVP for Developer Technologies)
    Homepage, Tipps, Tricks

    • Marked as answer by appleforce Thursday, May 21, 2020 10:03 AM
    Friday, May 15, 2020 9:25 AM
  • Well. OK, thanks.
    I have that reference.
    I have no clue how to create a new database.
    I guess and hope that CreateDatabase is the way, but I can't find out how.

    Maybe this is the way:

    Dim dbNew As DAO.Database = DBEngine.CreateDatabase(Dbase, dbLangSwedFin, dbVersion30)

    But now we (he?) can't fins Interop.DAIO, Version=5.0.0.0

    So I do not know


    Appleforce

    • Marked as answer by appleforce Thursday, May 21, 2020 10:04 AM
    Saturday, May 16, 2020 5:03 AM
  • I have no clue how to create a new database.

    For example (tested on Windows 10) =>

    Dim sDatabase As String = "E:\TestNewMDB.mdb"
    Dim cat As ADOX.Catalog = New ADOX.Catalog()
    cat.Create("Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & sDatabase & ";" & "Jet OLEDB:Engine Type=5")

    • Marked as answer by appleforce Thursday, May 21, 2020 10:04 AM
    Saturday, May 16, 2020 1:25 PM
  • Well, thanks.

     This is just the same thing as above, in the thread start,

    and produces the same error message.

    I would like to use CreateDatabase as there is a mothod with that name.

    Is that not possible to use?


    Appleforce

    • Marked as answer by appleforce Thursday, May 21, 2020 10:04 AM
    Sunday, May 17, 2020 10:55 AM
  • I cannot reproduce your problem

    Have you tried to remove/add "Microsoft ADO Ext. 6.0 for DDL and Security" ?

    • Marked as answer by appleforce Thursday, May 21, 2020 10:04 AM
    Sunday, May 17, 2020 11:19 AM
  • It also works with Microsoft.Office.Interop.Access.Dao =>

    ' Add reference to : Microsoft.Office.Interop.Access.Dao => "C:\Program Files (x86)\Common Files\Microsoft Shared\OFFICE16\ACEDAO.DLL"
    ' Add : Imports Microsoft.Office.Interop.Access.Dao
    
    Dim dbe = New DBEngine()
    Dim database = dbe.CreateDatabase("E:\TestMDB2.mdb", LanguageConstants.dbLangGeneral, DatabaseTypeEnum.dbVersion120)

    • Marked as answer by appleforce Thursday, May 21, 2020 10:04 AM
    Sunday, May 17, 2020 2:08 PM
  • The "Microsoft ADO Ext. 6.0 for DDL and Security" is added and can't be removedThe 

    The Microsoft.Office.Interop.Access.Dao 
    OK, Microdoft Office is not installed here

    Trying thee above Dim database = DBEngine.CreateDatabase(..)   results in:

    Err.Description
    "Objektvariabel eller With-blockvariabel is missing"

    I do not know what to do next


    Appleforce

    • Marked as answer by appleforce Thursday, May 21, 2020 10:04 AM
    Tuesday, May 19, 2020 6:13 AM
  • The "Microsoft ADO Ext. 6.0 for DDL and Security" is added and can't be removed

    "can't be removed" ?

    You cannot remove it by 

    ?

    • Marked as answer by appleforce Thursday, May 21, 2020 10:04 AM
    Tuesday, May 19, 2020 6:37 AM
  • And still Error 91 Err.Description "Objektvariabel eller With-blockvariabel is missing" or "not given" (I have to translate the swedish message) I do not know what that could be

    From Google, this error is :

    Object variable or With block variable not set

    • Marked as answer by appleforce Thursday, May 21, 2020 10:04 AM
    Tuesday, May 19, 2020 7:34 AM
  • I have been doing some testing.

    In a new project created in VB2019 with the only purpose to test Createdatabase, it is working fine.
    But the old project from VB2010 (and earlier) it is not

    Error # 5

    Could not load file or assembly 'Interop.DAO, Version=5.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencie. This assembly is of a later version ...

    I don't know how to get around this problem. Of course I want to use the old code from the former 2010-Project.



    Appleforce

    • Marked as answer by appleforce Thursday, May 21, 2020 10:04 AM
    Wednesday, May 20, 2020 12:55 PM

All replies

  • I Guess the right thing to do is to use 

    DBEngine.CreateDatabase(Dbase, dbLangSwedFin, dbVersion30)

    (and DBEngine.Compactdatabase(DBase, DBase_2) to compact)

    Now remains to find out how these functions are working, what need to be defined and so on.


    Appleforce


    • Edited by appleforce Friday, May 15, 2020 8:38 AM
    • Marked as answer by appleforce Thursday, May 21, 2020 10:03 AM
    Friday, May 15, 2020 8:27 AM
  • Hi,
    please check or include reference for ADOX:


    --
    Best Regards / Viele Grüße
    Peter Fleischer (former MVP for Developer Technologies)
    Homepage, Tipps, Tricks

    • Marked as answer by appleforce Thursday, May 21, 2020 10:03 AM
    Friday, May 15, 2020 9:25 AM
  • Well. OK, thanks.
    I have that reference.
    I have no clue how to create a new database.
    I guess and hope that CreateDatabase is the way, but I can't find out how.

    Maybe this is the way:

    Dim dbNew As DAO.Database = DBEngine.CreateDatabase(Dbase, dbLangSwedFin, dbVersion30)

    But now we (he?) can't fins Interop.DAIO, Version=5.0.0.0

    So I do not know


    Appleforce

    • Marked as answer by appleforce Thursday, May 21, 2020 10:04 AM
    Saturday, May 16, 2020 5:03 AM
  • I have no clue how to create a new database.

    For example (tested on Windows 10) =>

    Dim sDatabase As String = "E:\TestNewMDB.mdb"
    Dim cat As ADOX.Catalog = New ADOX.Catalog()
    cat.Create("Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & sDatabase & ";" & "Jet OLEDB:Engine Type=5")

    • Marked as answer by appleforce Thursday, May 21, 2020 10:04 AM
    Saturday, May 16, 2020 1:25 PM
  • Well, thanks.

     This is just the same thing as above, in the thread start,

    and produces the same error message.

    I would like to use CreateDatabase as there is a mothod with that name.

    Is that not possible to use?


    Appleforce

    • Marked as answer by appleforce Thursday, May 21, 2020 10:04 AM
    Sunday, May 17, 2020 10:55 AM
  • I cannot reproduce your problem

    Have you tried to remove/add "Microsoft ADO Ext. 6.0 for DDL and Security" ?

    • Marked as answer by appleforce Thursday, May 21, 2020 10:04 AM
    Sunday, May 17, 2020 11:19 AM
  • It also works with Microsoft.Office.Interop.Access.Dao =>

    ' Add reference to : Microsoft.Office.Interop.Access.Dao => "C:\Program Files (x86)\Common Files\Microsoft Shared\OFFICE16\ACEDAO.DLL"
    ' Add : Imports Microsoft.Office.Interop.Access.Dao
    
    Dim dbe = New DBEngine()
    Dim database = dbe.CreateDatabase("E:\TestMDB2.mdb", LanguageConstants.dbLangGeneral, DatabaseTypeEnum.dbVersion120)

    • Marked as answer by appleforce Thursday, May 21, 2020 10:04 AM
    Sunday, May 17, 2020 2:08 PM
  • The "Microsoft ADO Ext. 6.0 for DDL and Security" is added and can't be removedThe 

    The Microsoft.Office.Interop.Access.Dao 
    OK, Microdoft Office is not installed here

    Trying thee above Dim database = DBEngine.CreateDatabase(..)   results in:

    Err.Description
    "Objektvariabel eller With-blockvariabel is missing"

    I do not know what to do next


    Appleforce

    • Marked as answer by appleforce Thursday, May 21, 2020 10:04 AM
    Tuesday, May 19, 2020 6:13 AM
  • The "Microsoft ADO Ext. 6.0 for DDL and Security" is added and can't be removed

    "can't be removed" ?

    You cannot remove it by 

    ?

    • Marked as answer by appleforce Thursday, May 21, 2020 10:04 AM
    Tuesday, May 19, 2020 6:37 AM
  • OK, it can be removed, it is used in the program to change field lenghts, but that is now commented away. I guess there will be another solution to change field lengths. And still Error 91 Err.Description "Objektvariabel eller With-blockvariabel is missing" or "not given" (I have to translate the swedish message) I do not know what that could be

    Appleforce

    Tuesday, May 19, 2020 7:20 AM
  • And still Error 91 Err.Description "Objektvariabel eller With-blockvariabel is missing" or "not given" (I have to translate the swedish message) I do not know what that could be

    From Google, this error is :

    Object variable or With block variable not set

    • Marked as answer by appleforce Thursday, May 21, 2020 10:04 AM
    Tuesday, May 19, 2020 7:34 AM
  • I have been doing some testing.

    In a new project created in VB2019 with the only purpose to test Createdatabase, it is working fine.
    But the old project from VB2010 (and earlier) it is not

    Error # 5

    Could not load file or assembly 'Interop.DAO, Version=5.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencie. This assembly is of a later version ...

    I don't know how to get around this problem. Of course I want to use the old code from the former 2010-Project.



    Appleforce

    • Marked as answer by appleforce Thursday, May 21, 2020 10:04 AM
    Wednesday, May 20, 2020 12:55 PM
  • Problem still unsolved.

    Further discussions (hopefully) in

    https://social.msdn.microsoft.com/Forums/vstudio/en-US/490a8eaa-0c8b-445e-bec1-03f107090848/dbenginecreatedatabase?forum=vbgeneral


    Appleforce

    Sunday, May 24, 2020 9:12 AM