When upgrading a VB6 application (Access DB) to Windows 11 or to a new Windows 11 PC, a runtime error '3078' occurs.

haru 0 Reputation points
2024-09-16T22:48:02.4466667+00:00
  1. Even if I do, I can switch to another mode. I tried the compatibility mode (win95 to win8) and it's the same. I tried the compatibility troubleshooting you mentioned, but when I try to get the diagnostic application, the corresponding VB application EXE doesn't appear and it ends. When I change the location or name of the data, it says "Run-time error: 3044 Invalid path, is it specified correctly?", so I think the data is being read correctly. When I change it back, it says "Run-time error: 3078 Input table or query "~" not found. Please make sure that the table or query exists or that the name is correct." I received an article in the community that says "Please make sure that the input table, query, etc. exist correctly." But since the other win10 PCs (8 computers) share the same server data (Access), I don't think there is any difference in the tables, queries, etc. Is it a compatibility issue after all?
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
9,478 questions
0 comments No comments
{count} votes

4 answers

Sort by: Most helpful
  1. S.Sengupta 18,636 Reputation points MVP
    2024-09-17T01:06:19.2433333+00:00

    In a Visual Basic 6 (VB6) application, "Runtime error '3078'" indicates that the Microsoft Jet database engine cannot locate the specified input table or query,

    VB6 is a 32-bit application, and depending on the version of Access, you might encounter compatibility issues if the Access runtime is 64-bit.

    Try to run the application as Administrator.

    If required reinstall the application.

    0 comments No comments

  2. Neuvi Jiang 1,150 Reputation points Microsoft Vendor
    2024-09-17T06:32:20.5366667+00:00

    Hi haru,

    Thank you for posting in the Q&A Forums.

    Check the database file location:

    Ensure that the database file (.mdb or .accdb) is located on a path that is accessible to the application.

    If the database file is in a network location, check the network connection and sharing settings.

    Update the database connection string:

    Verify that the database connection string is correct, especially the path and file name.

    If the path contains special characters or spaces, make sure they are handled correctly (usually by adding quotes or escape characters).

    Run permissions:

    Make sure that the application is running as a user with sufficient permissions. In Windows 11, you may need to right-click on the application's shortcut or executable and select “Run as administrator”.

    Check the permission settings of the database file to ensure that the application has permission to read and write to the file.

    Compatibility Mode:

    Try running the VB6 application in compatibility mode. Right-click on the application's shortcut or executable file, select Properties, and then set the appropriate compatibility mode in the Compatibility tab (e.g. Windows 7 or Windows XP).

    Update or repair the VB6 runtime libraries:

    Make sure that all the necessary VB6 runtime libraries are installed and that they are up to date.

    If possible, try reinstalling the VB6 runtime libraries.

    Check the Access database engine:

    Ensure that the Microsoft Access Database Engine for your version of Access database is installed.If your database is in .accdb format, you need to install Access Database Engine 2010 or later.

    Check logs and error messages:

    Check the application's log files or the Windows Event Viewer for relevant error messages to get more clues about the cause of the error.

    Use the ODBC Data Source Manager:

    If your application uses ODBC to connect to the database, try reconfiguring the data source in the ODBC Data Source Manager.

    Update or migrate the database:

    Consider migrating the Access database to a newer format (e.g., .accdb, if your database is in the old .mdb format).

    If possible, migrate the database to a more powerful database system such as SQL Server and use a connection method that is more appropriate for the new system (e.g., ADO.NET).

    Best regards

    NeuviJ

    ============================================

    If the Answer is helpful, please click "Accept Answer" and upvote it.

    0 comments No comments

  3. haru 0 Reputation points
    2024-09-18T06:20:35.1733333+00:00

    Thank you for your reply. I don't see any problem when I open it in Access. It works fine on other PCs (win10), but when I start VB on my win11 PC, I get the error "Run-time error: 3078 Input table or query "~" not found" (I think it's in the Access database). They're all looking at the same mdb, so isn't this an internal problem with Access? If I switch to win11, will the read destination in the Access database (specified query/table) change? Thank you in advance.

    0 comments No comments

  4. MotoX80 33,376 Reputation points
    2024-09-18T19:49:01.05+00:00

    Its been a long time since I did any VB6 coding but here are some thoughts.

    How is the database defined in program? That is, are you using an ADODB.Connection, an ODBC entry, or some other VB control?

    What provider is it using?

    Here is a VB script that will list off the tables in an .mdb file. It uses the Jet provider and is able to read an old address list that I had on my Win11 laptop. Change the dbPath variable to point to your .mdb and see if it works.

    Be sure to use the 32 version of cscript.exe. From a command prompt run your script like this.

    C:\Windows\SysWOW64\cscript.exe C:\YourScriptsFolder\AccessTest.vbs
    
    Set objConn = CreateObject("ADODB.Connection")
    Set objRecordSet = CreateObject("ADODB.Recordset")
    ' Replace with your database path
    dbPath = "C:\Repl\AddressList.mdb"
    ' Open the connection
    objConn.Open "Provider=Microsoft Jet 4.0 OLE DB Provider;Data Source=" & dbPath
    ' Open the schema to get the tables
    Set objRecordSet = objConn.OpenSchema(20) ' 20 corresponds to adSchemaTables
    ' Loop through the tables and print their names
    Do Until objRecordSet.EOF
    	wscript.echo objRecordSet("TABLE_TYPE") & " - " & objRecordSet("TABLE_NAME")
        objRecordSet.MoveNext
    Loop
    ' Clean up
    objRecordSet.Close
    objConn.Close
    Set objRecordSet = Nothing
    Set objConn = Nothing
    

    In this post, the user solved his problem by doing a compact and repair.

    https://stackoverflow.com/questions/44082002/ms-access-error-3078-cannot-find-table-or-query

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.