Wrox Programmer Forums
VB Databases Basics Beginning-level VB coding questions specific to using VB with databases. Issues not specific to database use will be redirected to other forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB Databases Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old August 17th, 2005, 09:45 AM
Registered User
Join Date: Aug 2005
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default db connection

I have an application in Excel that queries an Access database. Some users have read-only access to the folder that the application is saved in. These users are not able to run the application as it errors out when referencing the database to open it to query. I do not want to grant all users READ/WRITE access. Is there another way around this? The application errors out at the last line of code that is pasted below.
Thank you!

    Dim wrkJet As Workspace
    Dim dbsFinance As Object
    'Dim conPubs As Connection
    Dim rstTemp As Object
    Dim strSQL As String
    Dim SearchOption As Integer


'Open Microsoft Jet and ODBCDirect workspaces, Microsoft
    ' Jet database, and ODBCDirect connection.
    Set wrkJet = CreateWorkspace("", "admin", "", dbUseJet)

    'Enter the location of the database below
    Set dbsFinance = wrkJet.OpenDatabase("C:\Feuerborn\Account-Level Rptg Tool\Acct-Lvl Rptg Tool.mdb")
Old August 19th, 2005, 02:08 PM
Friend of Wrox
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts

It is causing an error because of network access rights, not because of file rights. The users can't get into the folder, so there is no application file to access, hence the error. The database does not exist to this code. The code can't see what the user running the code has no right to see.
You need to move the mdb file to a location that all interested users can "see" it.
You can set the rights such that the users code can see it, but if the user opens Windows Explorer (and show hidden files and folders is NOT checked) the user won't see it.
I recently had a similar problem. I moved the back end to SQL to resolve it.
But it is a network rights issue, so coding is not going to get you there.


Similar Threads
Thread Thread Starter Forum Replies Last Post
db connection string Alexi ASP.NET 2.0 Basics 1 October 5th, 2006 05:25 AM
db connection dfeuerborn Excel VBA 1 August 19th, 2005 02:24 AM
db connection dfeuerborn Access VBA 1 August 17th, 2005 10:33 AM
DB Connection stu9820 ASP.NET 1.0 and 1.1 Basics 1 September 26th, 2004 09:01 PM
Preferred db connection mega Classic ASP Professional 3 July 2nd, 2004 08:39 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.