Re: ADO, ODBC, Service process
- From: "Francois Piette [ICS & Midware]" <francois.piette@xxxxxxxxxxx>
- Date: Fri, 29 Jul 2005 13:49:13 +0200
Thank you for your reply.
> "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\folder;Extended
> Properties=dBASE IV;User ID=Admin;Password="
I downloaded Jet engin 4.0 and used the connection string as you showed. I
used a UNC for datasource like "\\MyServer\MySharedFolder". This works well
when running as an application and has same problem as ODBC when run as a
service.
I played with the usercode and password. As I understand, it is used for the
DB which doesn't have any password and it is not used for the connection to
the file server which probably use the logged on user credential
(LocalSystem here who has no permission on the file server).
So the question is: how to select a usercode/password for connecting to the
fileserver programmatically, without changing the account under which the
service is logged ?
--
francois.piette@xxxxxxxxxxx
Author of ICS (Internet Component Suite, freeware)
Author of MidWare (Multi-tier framework, freeware)
http://www.overbyte.be
"Guillem" <guillemvicens-nospam@xxxxxxxxxxxxxxxxxx> a écrit dans le message
de news:42ea0446@xxxxxxxxxxxxxxxxxxxxxxxxx
> 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: Guillem
- Re: ADO, ODBC, Service process
- References:
- ADO, ODBC, Service process
- From: Francois Piette [ICS & Midware]
- Re: ADO, ODBC, Service process
- From: Guillem
- ADO, ODBC, Service process
- Prev by Date: Re: ADO, ODBC, Service process
- Next by Date: AdoConnection, MS SQL Server, and running out of CALs (Client Access Licenses)
- Previous by thread: Re: ADO, ODBC, Service process
- Next by thread: Re: ADO, ODBC, Service process
- Index(es):
Relevant Pages
|