views:

31

answers:

1

I'm trying export records from SQL Server 2008 to mdb file using OpenDataSource. It works when I log in using Windows authentication. But it fails when I use SQL Server authentication.

This is the error i get

OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)" returned message "Could not delete from specified tables.". Msg 7320, Level 16, State 2, Procedure EXPORT_Employee, Line 110 Cannot execute the query "DELETE FROM employee_export " against OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)".

Thanks

-Vivek

+1  A: 

A bit speculative but maybe you need to grant the SQL Server Service Account Write Access to the mdb file and make sure that you don't have it open at the same time.

Edit: A different type of permissions error anyway I think http://blogs.msdn.com/spike/archive/2008/07/23/ole-db-provider-microsoft-jet-oledb-4-0-for-linked-server-null-returned-message-unspecified-error.aspx

Martin Smith
Hi Martin, Thanks for the reply. Can you tell me how to do this?
Vivek Chandraprakash
Do what? Find out the service account? You should be able to see it if (on the server) you do start -> run "services.msc" then look for the "SQL Server (MSSQLServer)" service (or similar). Is the mdb file on the same machine as the server? If not is the service account a domain account?
Martin Smith
the mdb is on a different computer on the same network
Vivek Chandraprakash
I've updated my answer with a link with a different explanation for you to investigate. It might be that the service account cannot create a temporary DSN required. Probably best to get it working with the file on the same machine first to ensure you are not hitting that problem.
Martin Smith
it works when the file is on the same machine. fails when its on the netwrk
Vivek Chandraprakash
OK then it does sound just like permissions on the mdb itself. Is the service account a domain account?
Martin Smith
The Service account is domain account
Vivek Chandraprakash
You'll need to give the Account write permissions on the mdb file via Windows Explorer then. I think it might also need permissions on the containing folder so it can create its ldb file unless Access has changed since I last used it.
Martin Smith
Hi Martin,I tried creating linked server pointing to this mdb file on the network.and its working great.thanks a lot.-Vivek
Vivek Chandraprakash
Glad to hear you got it sorted!
Martin Smith