Board index » delphi » Unusual characters in alias database path

Unusual characters in alias database path

Von: "Thomas Minor" <Thomas.Mi...@REMOVE.THIS.materna.de>
Betreff: Unusual characters in alias database path
Datum: Montag, 7. Mai 2001 17:54

Hi.
I just fell over a little problem with the BDE aliases.

On a french system, the personal application data folder contains the
character ' , single quote.

When I try to access a table in such a directory, I only get the
error message : Unknown Filename.

Is there any known workaround or bugfix ?

Thanks,
Thomas Minor

 

Re:Unusual characters in alias database path


Is this with a BDE Alias set up using BDE Administrator and saved in the
IDAPI.CFG file, or with an alias created at run time?

You might want to look at
http://www.cix.co.uk/~bsparrow/delphi/tdatabase.html
--Bill Sparrow--
Member of the UK Borland User Group

Re:Unusual characters in alias database path


Quote
> Is this with a BDE Alias set up using BDE Administrator and saved in the
> IDAPI.CFG file, or with an alias created at run time?

I have this problem with an Alias created at runtime, but saved permanently
in
the idapi.cfg file (Session.AddStandardAlias(...))

Quote
> You might want to look at
> http://www.cix.co.uk/~bsparrow/delphi/tdatabase.html

I read the link and found it interesting, but unfortunately not very
usefull in my case.
The problem also occurs when I access a table in a path like " C:\a'b\"
directly by passing it the the TTable component.

yours

--

- -----------------------------------------------------------
  Thomas Minor
  MATERNA GmbH Information & Communications
  Telefon : +49 (231) 5599 - 169
  Fax     : +49 (231) 5599 - 67 169
-----------------------------------------------------------
  leghlaHchu'be'chugh mln lo'laHbe' taj jej.
  reH lugh charghwl'.
- -----------------------------------------------------------

Re:Unusual characters in alias database path


Yes.  Now that I've tried it I see that my question was immaterial.

As you say, any attempt to get a TTable or TQuery to use a directory with
an apostrophe in it by any of these methods fails:-
- by using an alias
- by placing the hard-coded directory name in the DatabaseName property of
the TTable or TQuery
- by placing the hard-coded directory name in the PATH parameter of a
TDatabase

All result in "Invalid file name".

I tried doubling the apostrophe, but that only resulted in the error
changing to "Invalid directory".  At least that proves that, previously,
it was seeing the directory as valid!

Interestingly, an SQL statement of the form:-
  select * from "E:\a'b\test.db"
is successful!

--Bill Sparrow--
Member of the UK Borland User Group

Re:Unusual characters in alias database path


Quote
> Yes.  Now that I've tried it I see that my question was immaterial.

Sad, but true :)

Quote
> As you say, any attempt to get a TTable or TQuery to use a directory with
> an apostrophe in it by any of these methods fails:-
> - by using an alias
> - by placing the hard-coded directory name in the DatabaseName property of
> the TTable or TQuery
> - by placing the hard-coded directory name in the PATH parameter of a
> TDatabase

Exact.
Those are the methods I thought of, too.

Quote

> All result in "Invalid file name".

> I tried doubling the apostrophe, but that only resulted in the error
> changing to "Invalid directory".  At least that proves that, previously,
> it was seeing the directory as valid!

Yes, escaping the apostrophe in any way did not succeed.

Quote
> Interestingly, an SQL statement of the form:-
>   select * from "E:\a'b\test.db"
> is successful!

Hmm,
never tried that. But it is not possible to convert/rewrite our application.
The profit would not justify the effort in this case.

I thought of using ShortPathNames to do the trick, but
sadly the apostrophe is a valid character and ShortPathName('c:\a''b')
will result in, guess what, "C:\a'b".

In borland.public.bde another user (Martin Golm) stated the following :
--- snip ---
A year (or so) ago I submitted a bug report on the fact that you can't
use paths that include German umlauts. The reply I got stated that this
isn't considered a bug. Which means it will not be fixed. I think this
also applies to your problems. The best bet would be to use short path
names, but I didn't try it myself.
--- snap ---

Not quite useful.
I hope Delphi 6 will give beter access to such paths.
Or gets rid of the BDE ...

-- ----------------------------------------------------------
  Thomas Minor
  MATERNA GmbH Information & Communications
  Telefon : +49 (231) 5599 - 169
  Fax     : +49 (231) 5599 - 67 169
-----------------------------------------------------------
  leghlaHchu'be'chugh mln lo'laHbe' taj jej.
  reH lugh charghwl'.
-- ----------------------------------------------------------

Other Threads