Re: ADO, ODBC, Service process



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
>
>


.



Relevant Pages

  • Re: How to load data in ListBox using one command from ADODB Recor
    ... Simply use an DSN-less connection string as the ODBC Connection String. ... >> Is there something unique about how you use the ADODB recordset? ... >>> I am using ADODB recordset and has SQL server database. ...
    (microsoft.public.access.gettingstarted)
  • Re: Use ADO.net 3.5 to connect with Excel 2003
    ... I try to google and everywhere give me the same connection string. ... The OLEDB providers for JET shipped separately from the standard MDAC. ... In some versions of .NET, if not all, you have to install JET ... I cannot find the download page, ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Use ADO.net 3.5 to connect with Excel 2003
    ... I try to google and everywhere give me the same connection string. ... I still get the sam message in my output window. ... The OLEDB providers for JET shipped separately from the standard MDAC. ... I cannot find the download page, ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: ODBC connection strings - "ODBC;" prefix?
    ... As you can see, if there is "ODBC;" in the connection string, ... Microsoft Online Community Support ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.vc.database)
  • Re: Use ADO.net 3.5 to connect with Excel 2003
    ... I try to google and everywhere give me the same connection string. ... The OLEDB providers for JET shipped separately from the standard MDAC. ... In some versions of .NET, if not all, you have to install JET ... I cannot find the download page, ...
    (microsoft.public.dotnet.framework.adonet)