Re: ADO, ODBC, Service process



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

  • List of Databases from ODBC Functions
    ... I am trying to get a list of all databases available for a ODBC ... conenction. ... iterate over all possible databases on the server. ...
    (microsoft.public.data.odbc)
  • Pervasive ODBC connection & clicking test = very slow?
    ... i have problem with performance of opening connection over ODBC ... put server address and click ... on button Get DSN list (get names of databases on Pervasive server) it ...
    (comp.databases.btrieve)
  • Re: Alternative to using DSN to connect to database
    ... you have to use .NET ODBC provider. ... Server is NOT optimized. ... Just because of the Admiistrator thinking DSN is easier for him to control ... > Basically my problem is that the ODBC Connection Manager in Control Panel ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Standard DBI Proposal
    ... If you're asserting that there is no ODBC on non-Windows platforms, ... Tcl command I can use to connect, ... This is what tclodbc does and I think ... My two workhorse databases are ...
    (comp.lang.tcl)
  • Re: SQL Server extremely slow
    ... terms of what is meant by a dis-connected ado recordset. ... table in a mdb file could be considered disconnected from the server ... Well, ok, but keep in mind the disk drive is on sql server! ... 10 reocrds from the server via odbc does not produce more ...
    (comp.databases.ms-access)