Re: ADO, ODBC, Service process
- From: "Guillem" <guillemvicens-nospam@xxxxxxxxxxxxxxxxxx>
- Date: Fri, 29 Jul 2005 12:26:13 +0200
Hi,
"Francois Piette [ICS & Midware]" <francois.piette@xxxxxxxxxxx> escribió en
el mensaje news:42e9e8a8$1@xxxxxxxxxxxxxxxxxxxxxxxxx
>I have an application that make use of the ADO components (Delphi 7) to
> access a dBase IV file using "Microsoft dBase Driver (*.dbf)". The DBF
> file
> is located on a file server. The directory on the server is mapped on a
> logicial unit on the computer where the program is running. Everything is
> OK
> when the application is run as a normal console mode application. But when
> run as a service, I can't access the DBF file. I get the error code
> $80004005 which is translated to this error message: "[Microsoft][Driver
> ODBC dBase]'(Unknown)' is not a valid path. Verify that the path name is
> correct and a connection is established with the server where the file is"
> (Appromiate translation to english, I use a localized Windows version).
if you are using the ADO components, i would rather suggest you to use the
OLE DB provider contained in Microsoft's Jet 4.0, than using the ODBC.
Reason for this is that ODBC is an older, already deprecated engine to
access databases. By using it, you add an extra layer to the communication
between your program and the database.
>
> As I understand, the program running as service has not the required
> permission to access the remote file. I need to have this service run
> under
> the LocalSystem account.
>
> How can I set the permissions to access the DBF file thru ODBC ?
AFAIK, you should be able to do this using the Extended Properties in the
connection string. If i'm not wrong, your connection string looks
aproximately like
"Driver={Microsoft dBASE Driver (*.dbf)};DriverID=277;Dbq=c:\mydbpath;"
instead of using this and having to install the ODBC driver, try following:
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\folder;Extended
Properties=dBASE IV;User ID=Admin;Password="
where User ID and Password would be the ones you need.
while Jet 4.0 is, AFAIK to be deprecated if not already, it is certainly
much better to use the OLE DB provider it has for your dBase database,
rather than use ADO + ODBC, as it is a newer technology. It is also usually
distributed with Microsoft's desktop databases. I'm not sure if it is
included in MDAC or you can download it separately. You could search for it
at http://msdn.microsoft.com/data/default.aspx
Good luck
--
Best regards :)
Guillem Vicens
Dep. Informática Green Service S.A.
www.clubgreenoasis.com
--
in order to contact me remove the -nospam
.
- Follow-Ups:
- Re: ADO, ODBC, Service process
- From: Francois Piette [ICS & Midware]
- Re: ADO, ODBC, Service process
- References:
- ADO, ODBC, Service process
- From: Francois Piette [ICS & Midware]
- ADO, ODBC, Service process
- Prev by Date: ADO, ODBC, Service process
- Next by Date: Re: ADO, ODBC, Service process
- Previous by thread: ADO, ODBC, Service process
- Next by thread: Re: ADO, ODBC, Service process
- Index(es):
Relevant Pages
|