Results 1 to 3 of 3
  1. #1
    Joakim N is offline Advanced Beginner
    Windows 7 32bit Access 2016
    Join Date
    Oct 2016
    Posts
    79

    Provider of CurrentProject

    Hi,

    I want to get the Provider as a string to CurrentProject for later use.

    In one database I get following string "Microsoft.ACE.OLEDB.12.0". From another database I get an error message (I have marked the command where error occurs beneath):

    Click image for larger version. 

Name:	Capture.PNG 
Views:	14 
Size:	7.6 KB 
ID:	26406



    I have been looking in File -> Options -> Current Database for different settings. I can't find anything. Anyone know what I shall do?

    Code:
    Public Sub MyProvider()
        
        Dim adConn As ADODB.Connection
        
        Set adConn = New ADODB.Connection
        adConn.Open CurrentProject.Connection          'This command creates an error from one database. Works fine in another.
        
        Debug.Print adConn.Provider
        
        adConn.Close
        Set adConn = Nothing
    End Sub

  2. #2
    vicsaccess's Avatar
    vicsaccess is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Apr 2015
    Posts
    451
    Joakim, did you see this post, it may be useful

    http://dailydoseofexcel.com/archives...-a-valid-path/

  3. #3
    Joakim N is offline Advanced Beginner
    Windows 7 32bit Access 2016
    Join Date
    Oct 2016
    Posts
    79
    Thanks for your reply.

    I copied my file to another folder and then back again to the original folder. Then the error disappeared. I have no idea why.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 05-20-2016, 01:30 AM
  2. OleDB Provider is not registered
    By Perceptus in forum Access
    Replies: 1
    Last Post: 01-22-2015, 01:35 PM
  3. How to import data with OLE DB provider for ORACLE?
    By medusa3604 in forum Import/Export Data
    Replies: 3
    Last Post: 12-16-2014, 01:05 PM
  4. Using CurrentProject.path
    By paddymx in forum Programming
    Replies: 10
    Last Post: 12-16-2013, 05:13 PM
  5. autoexec--currentproject.istrusted
    By Madmax in forum Access
    Replies: 1
    Last Post: 03-06-2012, 06:31 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums