+ Reply to Thread
Results 1 to 6 of 6

Access to Excel link, issue when db is open

  1. #1
    Forum Contributor
    Join Date
    03-27-2012
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    290

    Access to Excel link, issue when db is open

    I am trying to link a access DB to an excel sheet and everything works as expect it to, unless the DB is open.
    my db is an encrypted accdb file and I have connected it via the "From Access" wizard within excel.
    it is an encrypted file as I do not want the users to gain write-access to the tables that are in the database.

    the error I get is:
    "Do you wish to connect to 'db-location'?
    if I select "Yes" I get the excel "Data Link Properties" connection window expecting me to confirm the data source and enter a login and password. regardless of what I enter, I am brought to the same page as if I click "No".

    if I click "No", I get the "Microsoft Access Database Engine OLE DB Initialization Information" again asking me to verify the Data Source, Username, Password, Provider String and Open Mode.

    Is there a way to get around this?
    Possible thoughts:
    Create a new database which has a link to the back-end as well but dont password protect it, then attempt to link from the newly created front end?

    Thanks in advance for any help

  2. #2
    Valued Forum Contributor xlbiznes's Avatar
    Join Date
    02-22-2013
    Location
    Bahrain
    MS-Off Ver
    Excel 2007
    Posts
    1,223

    Re: Access to Excel link, issue when db is open

    Hi,

    try using ado and all your connect strings can be in the code behind (password protected) and the user will have nothing to do with this.

    Check out the attached query tool that connect to an excel file, you can change this to connect to different data sources.
    Attached Files Attached Files
    Happy Computing ,

    Xlbiznes.

    To show your appreciation please click *

  3. #3
    Forum Contributor
    Join Date
    03-27-2012
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    290

    Re: Access to Excel link, issue when db is open

    Thanks for the quick response, I have a few questions...

    As i want to extract into an already existing excel spreadsheet... I would assume that I am looking for the "Xlbiznes_extract_data" function? (to actually do the extracting)

    with this function you have: ThisWorkbook.Worksheets("Xlbiznes").Range("A5").CopyFromRecordset rec

    is it possible to enter data into a table range instead?

  4. #4
    Valued Forum Contributor xlbiznes's Avatar
    Join Date
    02-22-2013
    Location
    Bahrain
    MS-Off Ver
    Excel 2007
    Posts
    1,223

    Re: Access to Excel link, issue when db is open

    You can migrate the code from my sample workbook into your workbook and get the data placed into a cell that you wish.

    After firing the sql statement to extract the relevant data from your access table.

  5. #5
    Forum Contributor
    Join Date
    03-27-2012
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    290

    Re: Access to Excel link, issue when db is open

    I have the following:
    Please Login or Register  to view this content.
    my code fails at ".Open" saying that the database or object is read-only.
    I checked the file and its not in read-only so I can only assume that it is a network property that does give me sufficient rights?
    but... if that is the case... how was I able to import the data before using the connection wizard?

    additionally... all I want to do is read the information, I have no intention of actually importing

  6. #6
    Valued Forum Contributor xlbiznes's Avatar
    Join Date
    02-22-2013
    Location
    Bahrain
    MS-Off Ver
    Excel 2007
    Posts
    1,223

    Re: Access to Excel link, issue when db is open

    hi ,

    only these lines are required.

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Excel 07-Access 03 Data Link Issue
    By ddw23 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-23-2010, 08:58 AM
  2. how to link an Access Database from excel if it required a password to open
    By amrezzat in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-05-2006, 08:24 AM
  3. ole link from excel to access
    By JCanyoneer in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-20-2005, 01:25 PM
  4. Excel, Access Link
    By lehainam in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-27-2005, 03:08 AM
  5. Link Excel to Access
    By Marianna in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-04-2005, 08:17 AM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1