-
Dec 14th, 2013, 04:54 PM
#1
Thread Starter
Addicted Member
How can I get the physical path ofa a database?
Hello,
I have a question regarding the physical path of a database. How can I get it in a string?
I have this app that has many different projects in it. Each project has a given code. What I am interested in is the following task: if somebody opens a certain project from a certain computer then no one should be able to change that project code and some other information.
For this I was thinking that every time a project is opened I could create a file that is named the same as the projects code. Then when the project gets closed the file is erased.
This way, I can check anywhere from the server if a certain project is opened by some user and so I can stop unwanted changes to the project from that user.
So I was thinking to create these files in the same directory with the database. But how can I get this path to a string?
-
Dec 14th, 2013, 08:32 PM
#2
Re: How can I get the physical path ofa a database?
Hold on... this all sounds fishy to me... not in a bad way, but maybe in a bad convoluted kind of way... and none of it really made much sense... what do the projects have to do with anything? If you're compiling the app and sending it out,then why are you worried about your users changing the code? there's nothing for them to change. Why would they?
AS for the database... depends... if you're using a server-based DBMS like SQLServer or MySQL or Oracle, then you don't get a path... because there isn't one... it's on the server... if you're talking about a file-based system like Access... then YOU need to know where it is in one form or another... You can use |DataPath| in the connectionstring, but there isn't a way to expand it out to what the full path really is... it's something that's resolved by the system at run-time.
-tg
-
Dec 15th, 2013, 03:49 AM
#3
Thread Starter
Addicted Member
Re: How can I get the physical path ofa a database?
No no no. I didn't make myself clear. So this app manages the projects of a company. For each project that the company develops it gives a code and a name to the project. No each project has got information inside like: what to use, prices, suppliers, quantities and so on... for the purpose of that project.
What I wanted to do is for each user that uses the application to know what projects are currently being edited. And that's because while it's being edited (even by multiple users) I want to block only a couple of data to be modified. Like for example it's code. Because if somebody on a computer enters some components to be used in a certain project - other could change the code or name of the project and I don't want that to happen. That could be a problem.
I thought that creating some temporary files would be the easier way for each to know the projects that are being edited at the time.
-
Dec 15th, 2013, 03:54 AM
#4
Re: How can I get the physical path ofa a database?
Originally Posted by ovi_gm
I thought that creating some temporary files would be the easier way for each to know the projects that are being edited at the time.
It's hard to see how your request helps you there anyway but, regardless, you were wrong. The thing to do would be to create a record in the database.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|