dcsimg
Results 1 to 6 of 6

Thread: AccessRuntime or AccessDatabaseEngine or another alternative

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2011
    Location
    Malaysia
    Posts
    8

    Question AccessRuntime or AccessDatabaseEngine or another alternative

    I distribute a ready made Access 2007 file to my users when they install my application (vb6). It is used to store data - JUst tables, no other objects

    Users are instructed to install Access 2007 Runtime when they got the error "Provider Not Found". This happens when they do not have Access installed, or installed other versions of Access

    Everything is done from Vb6. Access is just for storing data. Only Tables. No other objects. Of course the tables have to maintain referential integrity, primary keys etc.

    Some of the functions done by vb6:

    CONNECTION:
    Dim cn As adodb.Connection
    Set cn = New adodb.Connection
    cn.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=D:\Database1.accdb;Jet OLEDB: DatabasePassword=123"

    TEST WHETHER TABEL EXIST:
    Dim rs As adodb.Recordset
    Set rs = cn.OpenSchema(adSchemaTables)
    Do Until rs.EOF
    If rs.Fields("TABLE_TYPE") = "TABLE" Then
    ' table name found
    If UCase$(rs.Fields("TABLE_NAME")) = UCase$("Table1") Then
    TableExistAdo = True
    Exit Do
    End If
    End If
    rs.MoveNext
    Loop

    COMPACT DATABASE
    Dim objEngine As Object
    Set objEngine = CreateObject("DAO.DBEngine.120")
    objEngine.CompactDatabase "D:\Database1.accdb.accdb", "D:\Database1.accdbcompact.accdb", , 128, ";pwd=123"

    Sql:
    DROP TABLE
    INSERT INTO

    My question:
    1) Can I just ask them to install AccessDatabaseEngine.exe rather than AccessRuntime.exe
    2) Better still, can the application just use the version of Access installed in users computer
    3) What do I need to do if users already installed 64 bit Access

    Thank you

  2. #2
    Frenzied Member
    Join Date
    Jun 2014
    Posts
    1,078

    Re: AccessRuntime or AccessDatabaseEngine or another alternative

    2) Better still, can the application just use the version of Access installed in users computer
    i suppose:
    if you create the database with code (DAO)
    then the version that is included by default in windows will be used
    i am on windows 10
    with access 2003
    if i create a database with DAO, a version 2000 is created
    this is done in excel
    Code:
    Sub DAOTEST2()
        Dim de As New DAO.DBEngine
        Dim db As DAO.Database
        Dim tdf As DAO.TableDef
        Dim fld As DAO.Field
        de.CreateDatabase "C:\00\TheDB", dbLangGeneral
        Set db = OpenDatabase("C:\00\TheDB")
        Set tdf = db.CreateTableDef("Table1")
        With tdf
            Set fld = .CreateField("TheId", dbLong)
            fld.Attributes = dbAutoIncrField + dbFixedField
            .Fields.Append fld
            .Fields.Append .CreateField("FirstName", dbText, 20)
        End With
        
        db.TableDefs.Append tdf
        Set fld = Nothing
        Set tdf = Nothing
         
        db.Close
        Set db = Nothing
        Set de = Nothing
    End Sub
    do not put off till tomorrow what you can put off forever

  3. #3
    Frenzied Member
    Join Date
    Jun 2014
    Posts
    1,078

    Re: AccessRuntime or AccessDatabaseEngine or another alternative

    2) Better still, can the application just use the version of Access installed in users computer
    i suppose:
    if you create the database with code (DAO)
    then the version that is included by default in windows will be used
    i am on windows 10
    with access 2003
    if i create a database with DAO, a version 2000 is created
    this is done in excel
    Code:
    Sub DAOTEST2()
        Dim de As New DAO.DBEngine
        Dim db As DAO.Database
        Dim tdf As DAO.TableDef
        Dim fld As DAO.Field
        de.CreateDatabase "C:\00\TheDB", dbLangGeneral
        Set db = OpenDatabase("C:\00\TheDB")
        Set tdf = db.CreateTableDef("Table1")
        With tdf
            Set fld = .CreateField("TheId", dbLong)
            fld.Attributes = dbAutoIncrField + dbFixedField
            .Fields.Append fld
            .Fields.Append .CreateField("FirstName", dbText, 20)
        End With
        
        db.TableDefs.Append tdf
        Set fld = Nothing
        Set tdf = Nothing
         
        db.Close
        Set db = Nothing
        Set de = Nothing
    End Sub
    do not put off till tomorrow what you can put off forever

  4. #4
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    3,847

    Re: AccessRuntime or AccessDatabaseEngine or another alternative

    I would convert the database from an Accdb to a Mdb file and use the Microsoft Jet Provider. The Jet provider has been pre installed on Windows machines since Win 7 (maybe earlier not sure about Vista). So unless you need the Ace Provider (doesn't sound like it), I would go to the Jet.

  5. #5

    Thread Starter
    New Member
    Join Date
    Feb 2011
    Location
    Malaysia
    Posts
    8

    Re: AccessRuntime or AccessDatabaseEngine or another alternative

    Thank you for the information. It is new information for me. I will definitely try and give feedback on this suggestion. Thank you

  6. #6

    Thread Starter
    New Member
    Join Date
    Feb 2011
    Location
    Malaysia
    Posts
    8

    Re: AccessRuntime or AccessDatabaseEngine or another alternative

    Latest update. With respect to my requirements above, I found that I would only require the AccessDatabaseEngine and not the AccessRuntime.

    I have tested on a few computers, and confirmed that the AccessDatabaseEngine is all that is required.


    Paul's answer in the thread below is very helpful:


    https://social.msdn.microsoft.com/Fo...tdataproviders

    I have yet to test on computers with 64 bit Office or on Office 2016 which is said to interfere with the connectivity

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width