🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.database.multi-tier
4 messages
4 total messages Started by Brian Phillips Thu, 06 Apr 2000 00:00
Find Database in Directory
#1222
Author: Brian Phillips
Date: Thu, 06 Apr 2000 00:00
15 lines
1154 bytes
Here is what I want to do :

String tempDBFname;
tempDBFname = User input database name;
if ( tempDBFname = is in the current working directory )
    open exsisting database;
  else
    open new database called tempDBFname;

I can't seem to get the code right for finding out if the 'tempDBFname'
in in the current working directory. I have been trying to get the
libary function 'FindDatabase(DatabaseName)'.  I was able to complile
but no matter what my input I aways recieved the same results. For
anyone could show me a working example or put me on a track that lead to
another answer I thank you now!!!
Re: Find Database in Directory
#1223
Author: Kim Hellan
Date: Fri, 07 Apr 2000 00:00
26 lines
1577 bytes
I'm not sure what you are trying to do......
Why are you operating on directories and not aliases? I assume that you are
using BDE and aliases?
Are you trying to connect to a database or open a table?
What database are we talking about (Paradox, MS Access)?

Kim Hellan


"Brian Phillips" <bphillip@csc.sctboces.org> wrote in message
news:38ED19C9.539D@csc.sctboces.org...
> Here is what I want to do :
>
> String tempDBFname;
> tempDBFname = User input database name;
> if ( tempDBFname = is in the current working directory )
>     open exsisting database;
>   else
>     open new database called tempDBFname;
>
> I can't seem to get the code right for finding out if the 'tempDBFname'
> in in the current working directory. I have been trying to get the
> libary function 'FindDatabase(DatabaseName)'.  I was able to complile
> but no matter what my input I aways recieved the same results. For
> anyone could show me a working example or put me on a track that lead to
> another answer I thank you now!!!
Re: Find Database in Directory
#1224
Author: Brian Phillips
Date: Fri, 07 Apr 2000 00:00
51 lines
2869 bytes
---------------------------------------------------------
Hi Kim;
       I'm useing a Paradox database to start with.  I am 
writting a program that creats two output database files 
for every date that the users enter when running the program. 
In other words - A user will open the program and have to 
enter a date on the screen before they can do any data entry 
or run any reports.  When the users enters a date into the 
program one of two things must happen.  First I use the date 
to create the name of the two database files.  Then(and this 
is my big problem) I need to check the directory the program 
is in to see if the two database already exsist.  If they do 
exsist I will just activate the database files for user access. 
If they do not exsist I will create them and then activate the 
database files for user access.  
        I don't have a choice in the programs output because 
I'm repaceing someones exsisting program that is part of a 
larger system. So I need to create the same output files as 
the old DOS based program.
        I hope this clears up any confussion. If there is any 
help you can give me "Thank You!" very much.
                          Brian
-------------------------------------------------------------
Kim Hellan wrote:
 
 I'm not sure what you are trying to do......
Why are you operating on directories and not aliases? 
I assume that you are using BDE and aliases?
Are you trying to connect to a database or open a table?
What database are we talking about (Paradox, MS Access)?
 
Kim Hellan
 
"Brian Phillips" <bphillip@csc.sctboces.org> 

Here is what I want to do :

String tempDBFname;
tempDBFname = User input database name;
if ( tempDBFname = is in the current working directory )
    open exsisting database;
   else
     open new database called tempDBFname;

 I can't seem to get the code right for finding out if the 
'tempDBFname' in in the current working directory. I have 
been trying to get the libary function 
'FindDatabase(DatabaseName)'.  I was able to complile but 
no matter what my input I aways recieved the same results. 
For anyone could show me a working example or put me on a 
track that lead to another answer I thank you now!!!
Re: Find Database in Directory
#1227
Author: Kim Hellan
Date: Mon, 10 Apr 2000 00:00
45 lines
2102 bytes
Hi Brian

Just to make things clear....
In Paradox, a "database" is a directory and each table in that database is
represented as a *.db file.
So what you are searching for is a table and not a database....right?

If you are not already using aliases, well.....then you should. Do not
operate directly on file names (table names).
If you then want to check for the existence of a specific table, you can use
a TTable component.
Set TTable::DatabaseName = "MYALIAS" and check out the TTable::Exists()
method.

Write again if this doesn't help you.

Kim Hellan


"Brian Phillips" <bphillip@csc.sctboces.org> wrote in message
news:38EE16D5.3CF8@csc.sctboces.org...
> ---------------------------------------------------------
> Hi Kim;
>        I'm useing a Paradox database to start with.
> -------------------------------------------------------------
> Kim Hellan wrote:
>
>  I'm not sure what you are trying to do......
> Why are you operating on directories and not aliases?
> I assume that you are using BDE and aliases?
> Are you trying to connect to a database or open a table?
> What database are we talking about (Paradox, MS Access)?
>
> Kim Hellan
>
> "Brian Phillips" <bphillip@csc.sctboces.org>
>
> Here is what I want to do :
>
> String tempDBFname;
> tempDBFname = User input database name;
> if ( tempDBFname = is in the current working directory )
>     open exsisting database;
>    else
>      open new database called tempDBFname;
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads