Results 1 to 4 of 4

Thread: How can I get the physical path ofa a database?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 2012
    Posts
    221

    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?

  2. #2
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,532

    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
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Sep 2012
    Posts
    221

    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.

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,302

    Re: How can I get the physical path ofa a database?

    Quote Originally Posted by ovi_gm View Post
    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
  •  



Click Here to Expand Forum to Full Width