• Hi, thanks for your posts.

    First of all i deleted my linked server and executed these lines of code to add another one :

    EXEC sp_addlinkedserver

    @server = N'provaPatenti',

    @provider = N'Microsoft.Jet.OLEDB.4.0',

    @srvproduct = N'OLE DB Provider for Jet',

    @datasrc = N'\\server2\patenti\patenti 2006.mdb'

    GO

    -- Set up login mapping using current user's security context

    EXEC sp_addlinkedsrvlogin

    @rmtsrvname = N'provaPatenti',

    @useself = N'false',

    @rmtuser = N'Admin',

    @rmtpassword = ''

    GO

    When i run a query on it it works well.

    When i execute the job (that simply call the same query tested before) i get a different error (can't open file):

    03/05/2008 08:43:15,provaImport,Error,1,PREFNO,provaImport,importPatenti,,Executed as user: NT AUTHORITY\SYSTEM. Cannot initialize the data source object of OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "ProvaPatenti". [SQLSTATE 42000] (Error 7303) OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "ProvaPatenti" returned message "Il modulo di gestione di database Microsoft Jet non è in grado di aprire il file '\\server2\patenti\Patenti 2003.mdb'. Il file è già aperto con accesso esclusivo da un altro utente o è necessario disporre dell'autorizzazione per visualizzare i dati.". [SQLSTATE 01000] (Error 7412). The step failed.,00:00:01,16,7412,,,,0

    At this point it must be a permission problem.

    What i didn't say before, and probably is important, the "patenti" folder on the server requires a username and a password to access it on the intranet. If the connection is not established before, even the call to the query out of the job fails (the job fails anyway either the connection is established or not).

    Thank you very much.