Solved

vb.net app running on citrix server can't open an access database

Posted on 2008-10-22
15
759 Views
Last Modified: 2012-05-05
When my vb.net program running on a citrix server tries to open an access database I get the error:
The MS Jet DB engine cannot open the file "blah....". It is already opened exclusively by another user or you need permission to view it's data.

I have the DB in the same folder as the app. When I log onto the citrix server I can run the app fine, but get the above error when running the program on a terminal.

Any ideas?
thankks,
bmutch
0
Comment
Question by:PACCAST-DEV
[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
  • 6
  • 5
  • 4
15 Comments
 

Author Comment

by:PACCAST-DEV
ID: 22781436
here is the connection code from the program:
 
myConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & AccessFilePath & ";" & _
"User Id=admin;Password=;"
myOleDbConnection = New OleDb.OleDbConnection(myConnectionString)
myOleDbConnection.Open()
0
 
LVL 38

Expert Comment

by:Jim P.
ID: 22781469
>> above error when running the program on a terminal.

Are you an admin or regular user on the TS session?

Does the user have full modify permissions to the folder the the mdb resides in?

Is anyone else in it at the same time?

Is there a residual ldb file hanging around that is owned by admin?
0
 
LVL 60

Expert Comment

by:Kevin Cross
ID: 22781510
How is the AccessFilePath specified.  Is it the absolute path OR a relative path?

I ask as I have two thoughts.  Usually from terminal server connection, users are very limited in terms of rights to local machine (server).  Therefore check the policies and/or NTFS rights to the MDB file.  You can try just opening the MDB file directly from terminal session if MS Access is one of the published applications.

Other thought, is that the application when running as a published application is starting from a different directory location; therefore, any relative references to Access file are not successful.  Try with the full path if not already coded that way OR a datasource defined in system DSN on citrix server.  

Regards,
Kevin
0
Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

 

Author Comment

by:PACCAST-DEV
ID: 22781641
regular user on the terminal
user has read-only permissions to the DB
noone else is in it
no ldb file is there
Private AccessFilePath As String = "\\citrix-01\c$\Furnace\DBProgress.mdb"
 
0
 
LVL 38

Accepted Solution

by:
Jim P. earned 250 total points
ID: 22781689
>> user has read-only permissions to the DB

That is most likely the problem. Anything accessing an Access DB needs to have permissions to create an ldb file in the same folder that the DB resides on. Change the user's (groups') permission on the folder to have read/write/create and delete and see how it goes.
0
 
LVL 60

Expert Comment

by:Kevin Cross
ID: 22781738
Agree with jimpen.
0
 

Author Comment

by:PACCAST-DEV
ID: 22781751
I gave the user's group full control to both the folder and the DB, logged on as the user to the citrix server, ran the program and still got the error msg...
0
 
LVL 60

Expert Comment

by:Kevin Cross
ID: 22781753
And since you are using a share to access, you may need to check the share permissions as the most restrictive will be applied.

It is fine to grant modify (I would reserve FULL for system/administrators) to specific groups that need access and then let the NTFS right of C: and Furnace folder handle where you want restrictions OR create a share directly on the Furnace folder and give it modify in both share and NTFS permissions for the user/group of users connecting via terminal services and update code to use that share path.

HTH
0
 
LVL 60

Assisted Solution

by:Kevin Cross
Kevin Cross earned 250 total points
ID: 22781769
And if this application is running on the Citrix server, then an alternative is to change path to:

C:\Furnace\DBProgress.mdb
0
 
LVL 38

Expert Comment

by:Jim P.
ID: 22781816
<semi off topic>
>> a share directly on the Furnace folder and give it modify in both
>> share and NTFS permissions for the

The way we pull off shares in our company is that we give Authenticated User full control on a share. Then we granulate the real NTFS permissions on the actual folders.

Our auditors have agreed with that approach in the past, and it simplifies the share administration tremendously.
</semi off topic>
0
 
LVL 60

Expert Comment

by:Kevin Cross
ID: 22781873
<semi off topic>
That is how we are doing this internally as well.  The MODIFY is more on the NTFS permissions side out of habit as get the 1 or 2 users with FULL rights that end up torquing the whole setup accidentally, so usually give all rights using MODIFY versus FULL.  Other than that, I whole heartedly agree. :)
</semi off topic>
0
 
LVL 38

Expert Comment

by:Jim P.
ID: 22781953
<semi off topic>
I thoroughly agree on the MODIFY for generic groups. NT Admin groups, service, system get full. Some app admin groups will get full if they absolutely need it. I have one app that requires the user group to have full.  In general the regular user group will get MODIFY.

Usually I'll yank "Everyone" off a lot of times and maybe give Authent Users maybe read, depending on the folder and location.
</semi off topic>
0
 

Author Comment

by:PACCAST-DEV
ID: 22800048
ok, thanks all.
I got it running by using the C:\Furnace\DBProgress.mdb pathname and giving read/write access to the folder.
 
0
 
LVL 38

Expert Comment

by:Jim P.
ID: 22800138
Glad to be of assistance. May all your days get brighter and brighter.
0
 
LVL 60

Expert Comment

by:Kevin Cross
ID: 22800300
Definitely our pleasure.  Jim thanks for the additional discussion.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

751 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