Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2013-12-26
4
Medium Priority
?
393 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
This article describes how you can use Custom Document Properties to store settings and other information in your workbook so that they will be available the next time you open the workbook.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

604 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