?
Solved

BDE Filesharing

Posted on 1998-12-06
3
Medium Priority
?
466 Views
Last Modified: 2013-11-23
I'm wanting to fileshare a database app (Paradox tables) on a LAN using standard BDE Aliases. The problem arises when I want to enable multiple accesses to the database. If I compile my app then I can run multiple copies on the local workstation with no problems, however, other users cannot connect. I fixed this by using Session.NetFileDir and Session.PrivateDir properties. This allows multiple users to access the table  ...  but now I can only run one instance of the app on each station. What do I need to do to allow multiple instances on multiple machines.

Thanx in advance

Darren
0
Comment
Question by:elkiors
[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
  • 2
3 Comments
 
LVL 27

Accepted Solution

by:
kretzschmar earned 80 total points
ID: 1349567
hi elkiors,

each instance will use a own privatedir

a sample for a random privatedir


          unit Unit1;

          interface

          uses
            Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
            Grids, DBGrids, Db, DBTables, filectrl;

          type
            TForm1 = class(TForm)
              Table1: TTable;
              DataSource1: TDataSource;
              DBGrid1: TDBGrid;
              TestSession: TSession;
              procedure FormCreate(Sender: TObject);
              procedure FormClose(Sender: TObject; var Action: TCloseAction);
            private
              { Private-Deklarationen }
            public
              { Public-Deklarationen }
            end;

          var
            Form1: TForm1;

          implementation

          {$R *.DFM}

          function randomname : String;
          var
            i : Integer;
            s : String;
          begin
            s := '';
            for i := 1 to 8 do
              s := s + chr(Random(25)+ 65); {Only Letters from A to Z}
            randomname := s;
          end;



          procedure TForm1.FormCreate(Sender: TObject);
          var s : String;
          begin
            s := Randomname;
            while DirectoryExists('c:\'+s) do s := Randomname;
            if createdir('c:\'+s) then
            begin
              TestSession.PrivateDir := 'c:\'+s;
              TestSession.Active := True;
              { open Database Components }
              table1.open;
            end
            else
            begin
              { Problem occured }
            end;
          end;

          procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
          var
            Found : Integer;
            SRec : TSearchRec;
          begin
            TestSession.Active := False; {All DatabaseConnections will be closed }
            { Delete Files in temporary Directory }
            Found := FindFirst(TestSession.PrivateDir+'\*.*', faAnyFile, SRec);
            while Found = 0 do
            begin
              If SRec.Name[1] <> '.' then {Ignore Entries . and .. }
                Deletefile(TestSession.PrivateDir+'\'+SRec.Name);
              Found := FindNext(SRec);
            end;
            FindClose(SRec);
            rmdir(TestSession.PrivateDir);
          end;

          end.

Thats is a simple Example. Their are no Try-Except Blocks in it, so it can be that by the
Filehandling raised an Exception.

I hope you can use this tip

meikl
0
 

Author Comment

by:elkiors
ID: 1349568
Hi Meikl,

I haven't tested the code but I can see what you're getting at, I kind of stumbled across the multiple private dirs myself while I was at work today, although I had know idea on how to go about testing for the existing session, so that's a great help.

BTW Just got notification of you asking if anyone is around on Q10097306 Updating a Paradox Table - the one by RainbowSoftware.

I have a feeling that bird has flown, so I haven't bothered to respond again, otherwise we'll just keep triggering eachother to look at that page.

It's to be hoped that he hasn't just taken an answer and run. For me it's plain common courtesy that makes this site as enjoyable as it is. When other's take advantage or become abusive then it puts a downer on the whole shebang.

Anyway I've rambled along enough, sorry there wasn't anymore points available , I'm just about running on empty.

See you on another thread

Darren
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 1349569
hi darren,

i will remember rainbowsoftware about Q10097306, if he/she/it place a new question here.
about the points, that doesn't matter, i am not here to get points en mas, its ok.

See you on another thread again

meikl


Q10097306
0

Featured Post

Technology Partners: 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

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses
Course of the Month9 days, 13 hours left to enroll

762 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