Selecting from linked server gives error

  • Hello!

    I try to import a text file into a SQL 7 database via a linked server (Jet 4.0). I use a simple select statement:

    SELECT * FROM sisimport...[import#txt]

    It works fine when executed from an account with the highest level of server roles (sysadmin) but not with anything less powerfull. I get the message "Could not create an instance of OLE DB provider 'Microsoft.Jet.OLEDB.4.0'". I don't want to use a system administrator account since this account is to be used with IIS.

  • OK, I have figured out a workaround to my problem. I use the openrowset instead of creating a linked server:

    SELECT a.*

    FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',

    'W:\Inetpub\wwwroot\sisflow\import\register.mdb';'admin';'', 'SELECT * FROM [Text;Database=W:\Inetpub\wwwroot\sisflow\import\].[test.txt]')

    AS a

    The thing is that I have to put a fake Access database somewhere to get this to work. You don't need to give your user any server role.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply