Solved

Connection string to ACCESS 2010 From EXCEL 2010 no longer recognizes file

Posted on 2013-12-26
4
380 Views
Last Modified: 2013-12-28
I have been using he below to import data but now it says it does no recognize the file!  I am opening ACCESS 2010 table from Excel 2010 with a select query, but now it won't even open the connection.  Any suggestions on what I could look for to figure out why it worked and now won't?  When I try to open with the Data tab using a query, I also now get unrecognized format, but it all looks fine.

Sandra

Dim conn As New ADODB.Connection
Dim rst As New ADODB.Recordset
Dim sSQL As String
Dim rng As Range
Dim Wks As Worksheet
Dim strCellAddress As String
Dim rngName As Range


    Set conn = New ADODB.Connection
    conn.Provider = "Microsoft.ACE.OLEDB.12.0;"
    conn.ConnectionString = strDatabasePath
    conn.Open
    Set rng = ThisWorkbook.Worksheets("ListData").Range("A6")

    Set rst = New ADODB.Recordset
0
Comment
Question by:ssmith94015
  • 2
  • 2
4 Comments
 
LVL 21
ID: 39740952
Where is the variable strDatabasePath DIM'ed?

Where is the value for strDatabasePath set?

Does strDatabasePath still have the correct path tot eh database (.accdb)?
0
 

Author Comment

by:ssmith94015
ID: 39740965
The variable  is defined in the calling procedure and passed in as a string and the path was the first thing I checked
0
 
LVL 21

Accepted Solution

by:
Boyd (HiTechCoach) Trimmell, Microsoft Access MVP earned 500 total points
ID: 39741018
Thanks for the info.

Have you tried opening the database to see if it needs repaired?  Be sure t make a backup before opening the database with Access just to be sage.

I would also run compact on the database after you make a backup. That will hep you cjheck to be sure the database is good.
0
 

Author Closing Comment

by:ssmith94015
ID: 39743800
I did all this. It it did lead me to the answer.  It is not the database, it is my machine.  When I moved to my laptop, it worked.  At least I can finish, but have to repair my main machine.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

User Beware!  This is a rather permanent solution to removing your email from an exchange server.  The only way to truly go back is to have your exchange administrator restore your mailbox from backups.  This is usually the option of last resort.  A…
The new Microsoft OS looks great, is easier than ever to upgrade to, it is even free.  So what's the catch?  If you don't change the privacy settings, Microsoft will, in accordance with the (EULA) you clicked okay to without reading, collect all the…
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now