Board index » delphi » TTable reporting "Invalid File Name"

TTable reporting "Invalid File Name"

I've got a TTable, where I manually set the TTable.DatabaseName to:

H:\DaVinci Exported lessons\What it can be 10-27-98\

The Table name is TestHead.DB

Both the path and the table name are valid.  However, when I TTable.Open, it
reports "Invalid File Name".  What's going on here?  I don't have this error
when opening this file with other path's.  What's wrong with the above path?

H: is a cd-rom drive.  The file TestHead.DB is set to attrib R (Read Only).
I tried copying the file to my hard drive, in the exact file path, and it
opens it on the hard drive without a problem.  I copied the TestHead.DB file
directly from the CD, so I know it's not a bad copy on the CD.  I also tried
opening the file in ReadOnly mode on the CD, and it still won't open it on
the H: (CD-Rom) drive.

Thanks,
Jesse

 

Re:TTable reporting "Invalid File Name"


Quote
Jesse Castleberry wrote:
> I've got a TTable, where I manually set the TTable.DatabaseName to:

> H:\DaVinci Exported lessons\What it can be 10-27-98\

> The Table name is TestHead.DB

> Both the path and the table name are valid.  However, when I TTable.Open, it
> reports "Invalid File Name".  What's going on here?  I don't have this error
> when opening this file with other path's.  What's wrong with the above path?

> H: is a cd-rom drive.  The file TestHead.DB is set to attrib R (Read Only).
> I tried copying the file to my hard drive, in the exact file path, and it
> opens it on the hard drive without a problem.  I copied the TestHead.DB file
> directly from the CD, so I know it's not a bad copy on the CD.  I also tried
> opening the file in ReadOnly mode on the CD, and it still won't open it on
> the H: (CD-Rom) drive.

> Thanks,
> Jesse

    You can not assign some directory to DatabaseName property. You must create
alias and use it insted of direstory. Alias can be created using Database
Desktop or BDE Administrator. Database Desktop is easier. In TOOLS menu you have
ALIAS MENAGER submenu that pop ups you a dialog for creatting aliases.

Re:TTable reporting "Invalid File Name"


Quote
>    You can not assign some directory to DatabaseName property. You must
create
>alias and use it insted of direstory. Alias can be created using Database
>Desktop or BDE Administrator. Database Desktop is easier. In TOOLS menu you
have
>ALIAS MENAGER submenu that pop ups you a dialog for creatting aliases.

Not so, I do this sort of thing ALL OF THE TIME.  As a matter of fact, I
have two applications based on this.  I don't have a single BDE Alias
defined, I set my DatabaseName properties to path's through the entire
program at run time, and it works great.

Jesse

Re:TTable reporting "Invalid File Name"


Quote
Jesse Castleberry wrote in message ...
>>    You can not assign some directory to DatabaseName property. You
must
>create
>>alias and use it insted of direstory. Alias can be created using
Database
>>Desktop or BDE Administrator. Database Desktop is easier. In TOOLS
menu you
>have
>>ALIAS MENAGER submenu that pop ups you a dialog for creatting
aliases.

>Not so, I do this sort of thing ALL OF THE TIME.  As a matter of
fact, I
>have two applications based on this.  I don't have a single BDE Alias
>defined, I set my DatabaseName properties to path's through the
entire
>program at run time, and it works great.

>Jesse

You're right Jesse, you can use a path for the DatabaseName property.
However, it's really not a good habit to force things into a certain
path. Give the user some flexibility. If you use an alias, the user
can move the data (say to another hard drive because their main drive
is full), change the alias, and continue to use the program without
bothering you (and that's always good!). :-)

I don't really know why you can't open the file on the cdrom. Maybe
the open operation times out because the cdrom takes too long to spin
up??? Obviously, I'm just guessing here.

Scott

Re:TTable reporting "Invalid File Name"


  You are correct (I HATE using Aliases....  (What happens when the users moves
the tables on you!))  --  What version of the BDE are you using?  --  "Invalid
File Name" usually pops up on FAT32 with BDE 4.5 or lower....

--
Jason Wallace
SL Software
Dark...@SLSoftware.reno.nv.us
--
"We are Microsoft.  You will be assimilated.  Resistance is Futile."
--

Quote
Jesse Castleberry wrote in message ...
>>    You can not assign some directory to DatabaseName property. You must
>create
>>alias and use it insted of direstory. Alias can be created using Database
>>Desktop or BDE Administrator. Database Desktop is easier. In TOOLS menu you
>have
>>ALIAS MENAGER submenu that pop ups you a dialog for creatting aliases.

>Not so, I do this sort of thing ALL OF THE TIME.  As a matter of fact, I
>have two applications based on this.  I don't have a single BDE Alias
>defined, I set my DatabaseName properties to path's through the entire
>program at run time, and it works great.

>Jesse

Re:TTable reporting "Invalid File Name"


What happens when the users move tables and you are NOT using an alias
is that you have to change every path in your program, recompile it,
then redistribute it. If you are using an alias, you just change the
path for the alias (takes 2 minutes).

Alternatively, you can force the user to keep the databases in the
directory that you dictate. This is assuming that you know better than
the user where they should keep their stuff.

Just my 2 cents...

Scott

Quote
Jason Wallace wrote in message <3638a31...@news.greatbasin.net>...
>  You are correct (I HATE using Aliases....  (What happens when the
users moves
>the tables on you!))  --  What version of the BDE are you using?  --
"Invalid
>File Name" usually pops up on FAT32 with BDE 4.5 or lower....

>--
>Jason Wallace
>SL Software
>Dark...@SLSoftware.reno.nv.us
>--
>"We are Microsoft.  You will be assimilated.  Resistance is Futile."
>--

Re:TTable reporting "Invalid File Name"


In article <ZpEZ1.1504$Qf3.2...@news9.ispnews.com>, "Jesse Castleberry"

Quote
<D...@iThink.net> writes:
>Both the path and the table name are valid.  However, when I TTable.Open, it
>reports "Invalid File Name".  What's going on here?  I don't have this error
>when opening this file with other path's.  What's wrong with the above path?

I don't really know, but check the short and long names for the HD and the
CD-ROM as reported by DIR in DOS Window. See if there's any difference.

Also try using the short names.

These _might_ give you some clues, but these are "finger in the wind" stuff <g>

Alan Lloyd
alangll...@aol.com

Re:TTable reporting "Invalid File Name"


Quote
Scott Roberts wrote in message <71aebo$3...@news1.iamerica.net>...
>What happens when the users move tables and you are NOT using an alias
>is that you have to change every path in your program, recompile it,
>then redistribute it. If you are using an alias, you just change the
>path for the alias (takes 2 minutes).

That's not the way I'm handeling it.  In one of my app's, I allow the user
to generate different data sets, and to tell me where the path is.  This is
one reason why ALIASes won't work for this particular app.  I would have to
have an ALIAS for each path that the user has created.

In another instance, I simply put the data in the same directory where the
program (I've been told this is a no-no, but it seems to be working fine for
me), and direct the data to the same place where the program is.  If the
user "moves" the data, then they screwed up.  it's not like i have a hard
coded data path set in my program like "c:\mydata", the data path is
"dynamic", based on where the program .EXE file resides.

Jesse

Re:TTable reporting "Invalid File Name"


Quote
On Thu, 29 Oct 1998, Scott Roberts wrote:

> Jesse Castleberry wrote in message ...
> >>    You can not assign some directory to DatabaseName property. You
> must
> >create
> >>alias and use it insted of direstory. Alias can be created using
> Database
> >>Desktop or BDE Administrator. Database Desktop is easier. In TOOLS
> menu you
> >have
> >>ALIAS MENAGER submenu that pop ups you a dialog for creatting
> aliases.

> >Not so, I do this sort of thing ALL OF THE TIME.  As a matter of
> fact, I
> >have two applications based on this.  I don't have a single BDE Alias
> >defined, I set my DatabaseName properties to path's through the
> entire
> >program at run time, and it works great.

> >Jesse

> You're right Jesse, you can use a path for the DatabaseName property.

  Absolutely.

Quote
> However, it's really not a good habit to force things into a certain
> path. Give the user some flexibility. If you use an alias, the user
> can move the data (say to another hard drive because their main drive
> is full), change the alias, and continue to use the program without
> bothering you (and that's always good!). :-)

  I kind of disagreed with that. You can set the databasename as a
  variable and pass in the value by reading a config file because the
  user may not know how to set up an alias. That's more a developer's
  part, to me at least :-)

- Show quoted text -

Quote

> I don't really know why you can't open the file on the cdrom. Maybe
> the open operation times out because the cdrom takes too long to spin
> up??? Obviously, I'm just guessing here.

> Scott

Other Threads