CSLA 1.52 - DataPortal failure. DB is read only??!!

CSLA 1.52 - DataPortal failure. DB is read only??!!

Old forum URL: forums.lhotka.net/forums/t/2492.aspx


Q Johnson posted on Thursday, March 08, 2007


I have an WinForms application that uses a JET database.  The app and the db are both installed on a user's workstation at my client's office and it works just splendidly there (he said, modestly <g>).

I installed the app (by file copy, except for the db which they need to share) on to her boss' computer and established a share to the folder on her machine.  I went to the config file and changed the relevant lines in it from:

<add key="DB:TagTracker.mdb" value="Provider=Microsoft.Jet.OLEDB.4.0; User ID=Admin; Data Source=C:\Program Files\TagTracker\TagTracker.mdb; Persist Security Info=False" />

to:

<add key="DB:TagTracker.mdb" value="Provider=Microsoft.Jet.OLEDB.4.0; User ID=Admin; Data Source=N:\TagTracker.mdb; Persist Security Info=False" />

The app uses the regular technique of using the DB() function to establish the db connection, ala:

Dim cn As New OleDbConnection(db("TagTracker.mdb"))

As I said, EVERYTHING works on HER workstation.  But on his? I can open the app, retrieve my objects, and even execute a database compact operation.  But I get a DataPortal failure when I try to save the app's main EditableRootObject.

When I opened the database with Access from his computer, I get a notification that the database is Read-Only even though its read-only flag isn't showing up on the file properties in Windows Explorer and neither the app nor the database are in use on the other machine. 

I have gone into permissions on the shared drive and given him Full Control.  I even changed the .NET 1.1 CodeAccessSecurity to TrustAll for anything from that share.

Still no joy.

Any ideas?  Thanks in advance.

ajj3085 replied on Thursday, March 08, 2007

I'd check the NTFS file permissions on the 'server' computer.  Also check the Share permissions as well; it could be the share permissions are set to read only, which wouldn't show up on the file properties.

Q Johnson replied on Thursday, March 08, 2007

How would I find that Read-Only attribute on the sharing permissions.  I can't find it in the UI offered in Windows Explorer.  But I'm not used to work with this stuff, so I"m probably walking right past it without realizing.

 

Q

JoeFallon1 replied on Friday, March 09, 2007

Whenever you open a JET database it has to create a .ldb file for locking purposes.
If it can't create the file you get the READONLY error.
This is very common when trying to run a .mdb from a CD drive.

Give your user permission to create files in the shared folder and it should be fine.

If you open the .mdb in Exclusive mode then it won't try and create the .ldb file.
But then your app is single user.

Joe

 

 

ajj3085 replied on Friday, March 09, 2007

On the server machine, right cilck the folder and choose Sharing and Security.  You'll be on the sharing tag.  Click the Permissions button on that screen.  I think Change should be enough, but I'm not sure so you may want to try Full Control too. 

This assumes Windows XP SP2.

Q Johnson replied on Monday, March 12, 2007

Thanks for the help on this.  I discovered that the I was confusing the user's logon on for his OWN machince (which couldn't gain access) with the one set up for him on the host computer. 

I never could figure out how to identify ONLY him among other users trying to gain access from the network, but I was able to give Everyone permission.  Since no one else knows the app is even here, this is probably safe until tomorrow when their IT guy can come up with something better.

Thanks again.

ajj3085 replied on Monday, March 12, 2007

Are the machines part of the domain?

If they aren't you could create an account on the 'host' server for this remote user, and have him set the password as the same one he uses on his own workstation.  Then as long as the passwords are in sync, the login will succeed, and you can assign just his account to the share permissions.

Q Johnson replied on Monday, March 12, 2007

Thanks for that.  I don't know if the passwords are the same or not. 

On her computer (the host), his user shows up for permissions as Matt/TAX1 and TAX1 is her machine.  His is TAX2 and no TAX2 shows up for permissions use on the share.

There are other servers in their environment (a dozen or more) so I'd bet that they are part of a domain.  So this is definitely worth pursuing.

Thanks again!

ajj3085 replied on Tuesday, March 13, 2007

Hmm.. well if there is a domain in place, everything is simplier... but it sounds like Matt is a local account on the workstation TAX1.  It would be very odd that TAX1 is part of a domain, but the user has a local account.  If possible, I'd see if you couldn't move them to their domain accounts.

Copyright (c) Marimer LLC