 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Stig Ove H Guest
|
Posted: Tue Sep 07, 2004 9:34 am Post subject: Using BCB5 to access single Pardox table via network |
|
|
I was asked to do a simple DB-app at work. It would consist of only one
table wich is to be stored on a shared location on our network. So far my
experience with DB-apps grinds to a halt at simple Paradox7 DB-apps.
I tried a simple setup to see wether I could access the DB via the network.
Wrote a new Alias and everything worked fine.
But the problem is when I want several compoters to access the table at
once. Can I do this at all with standard BCB5 Queries and simple PDX-tables
or do I have to turn to 3rd party DB-engines etc.?
Any hints or links would be appreciated :)
|
|
| Back to top |
|
 |
Jayme Jeffman Filho Guest
|
Posted: Wed Sep 08, 2004 1:12 pm Post subject: Re: Using BCB5 to access single Pardox table via network |
|
|
Hello Stig,
You can use the same application you've developed. You only have to
set up some Session (TSession) parameters, the NetFileDir and, if necessary,
the PrivateDir (recommended). Look for them in the C++Builder Help file.
You don't need to drop down a TSession component, you can just use the
global Session.
If you don't mind I'd like to remind you that the Borland database
components
supports UNC path values, so use them instead of mapped network locations.
When you open a Paradox table through the network two "lck" extension
files are created and the BDE write on "pdoxusrs.lck" the complete
directory path where it is located the "pdoxusrs.net" file, so if you use
mapped
network locations you should assure that all the mapped network locations
are using the same drive letter, otherwise you'll get a "another net file
directory
is in use" error.
In my opinion, the most important items on Paradox network programming
are : 1- Setting up the NetFileDir parameter; 2- User access rights on the
network directory; 3- Transaction control.
HTH
Jayme.
"Stig Ove H" <stigoh (AT) tiscali (DOT) no> escreveu na mensagem
news:413d809e (AT) newsgroups (DOT) borland.com...
| Quote: | I was asked to do a simple DB-app at work. It would consist of only one
table wich is to be stored on a shared location on our network. So far my
experience with DB-apps grinds to a halt at simple Paradox7 DB-apps.
I tried a simple setup to see wether I could access the DB via the
network.
Wrote a new Alias and everything worked fine.
But the problem is when I want several compoters to access the table at
once. Can I do this at all with standard BCB5 Queries and simple
PDX-tables
or do I have to turn to 3rd party DB-engines etc.?
Any hints or links would be appreciated :)
|
|
|
| Back to top |
|
 |
Stig Ove H Guest
|
Posted: Thu Sep 09, 2004 9:45 am Post subject: Re: Using BCB5 to access single Pardox table via network |
|
|
Thanx for good anwer. Actually I just found out 'bout the TSession myself
*proud*
| Quote: | If you don't mind I'd like to remind you that the Borland database
components
supports UNC path values, so use them instead of mapped network locations.
|
That's what I'm using for my test setup
| Quote: | In my opinion, the most important items on Paradox network programming
are : 1- Setting up the NetFileDir parameter; 2- User access rights on the
network directory; 3- Transaction control.
|
What lies within "Transaction Control"? Feel there's an obvious anser,
asking none the less.
Is there any way of telling if others are using the table?
|
|
| Back to top |
|
 |
Jayme Jeffman Filho Guest
|
Posted: Thu Sep 09, 2004 12:25 pm Post subject: Re: Using BCB5 to access single Pardox table via network |
|
|
| Quote: | What lies within "Transaction Control"? Feel there's an obvious anser,
asking none the less.
There are two ways of getting the data saved to disk : |
1. Setting the BDE LocalShare parameter to true (default = false) , or
2. Control the transaction block by yourself calling the TDatabase methods
StartTransaction, Rollback or Commit when appropiate.
| Quote: | Is there any way of telling if others are using the table?
I'm afraid not, you don't have any method or property, except the |
"Exclusive"
opening mode which lock the whole table and its not necessary, as long as
BDE can manage the concurrence of updating actions. The risk of the
data have been modified after you've got it still remains.
There are some good links at http://community.borland.com, check theese:
http://community.borland.com/article/0,1410,16437,00.html ;
http://community.borland.com/article/0,1410,15809,00.html ;
http://community.borland.com/article/0,1410,15283,00.html
|
|
| Back to top |
|
 |
Stig Ove H Guest
|
Posted: Thu Sep 09, 2004 1:21 pm Post subject: Re: Using BCB5 to access single Pardox table via network |
|
|
"Jayme Jeffman Filho" <jaymenosp (AT) jeffman (DOT) eng.br> skrev i melding
news:41404d05$1 (AT) newsgroups (DOT) borland.com...
| Quote: | What lies within "Transaction Control"? Feel there's an obvious anser,
asking none the less.
There are two ways of getting the data saved to disk :
1. Setting the BDE LocalShare parameter to true (default = false) , or
2. Control the transaction block by yourself calling the TDatabase methods
StartTransaction, Rollback or Commit when appropiate.
|
Umm, There's one catch though. Im using TQuery to get the subsets I need to
display.
Will the Post() function do? Read somwhere else that the only way to be sure
the changes are posted with Queries is to Close/Open it..
Oh, and thank you for taking the time with my pitiful ignorance :)
|
|
| Back to top |
|
 |
Jayme Jeffman Filho Guest
|
Posted: Thu Sep 09, 2004 8:49 pm Post subject: Re: Using BCB5 to access single Pardox table via network |
|
|
| Quote: | Will the Post() function do? Read somwhere else that the only way to be
sure
the changes are posted with Queries is to Close/Open it..
|
When BDE LocalShare parameter is set to its default value (false)
the data is not saved to disk except if you call the TDatabase
Commit method, closing the transaction block.
I'd reather to use explicit transaction blocks than set up the
LocalShare parameter like the code bellow :
if(!Database->InTransaction) Database->StartTransaction();
DataSet->Insert() ; // or Edit();
// Set up data values
DataSet->FieldByName("FieldName1")->Value = value;
try{
DataSet->Post();
if(Database->InTransaction) Database->Commit();
}
catch(...){
if(Database->InTransaction) Database->Rollback();
DataSet->Cancel();
throw;
}
HTH
Jayme.
|
|
| Back to top |
|
 |
MarkR Guest
|
Posted: Thu Sep 09, 2004 9:58 pm Post subject: Re: Using BCB5 to access single Pardox table via network |
|
|
| Quote: | supports UNC path values, so use them instead of mapped network locations.
|
What aretUNC paths? I currently use something like z:serverdata how would
that equate to a UNC path??
|
|
| Back to top |
|
 |
Jayme Jeffman Filho Guest
|
Posted: Fri Sep 10, 2004 12:50 pm Post subject: Re: Using BCB5 to access single Pardox table via network |
|
|
Hello Mark,
UNC stands for Universal Naming Convention . The paths in the UNC
format are not mapped to a drive letter like you wrote, but they include
the network node name (machine name) like in "\serverrootdatabase" .
HTH
Jayme.
"MarkR" <markcr (AT) wapthespamntlworld (DOT) com> escreveu na mensagem
news:4140d209 (AT) newsgroups (DOT) borland.com...
| Quote: | supports UNC path values, so use them instead of mapped network
locations.
What aretUNC paths? I currently use something like z:serverdata how
would
that equate to a UNC path??
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|