Unix Technical Forum

Connecting to Access database on another computer

This is a discussion on Connecting to Access database on another computer within the MS SQL ODBC forums, part of the Microsoft SQL Server category; --> If I do the following, it works... EXEC sp_addlinkedserver @server = test , @srvproduct = 'Jet 4.0', @provider = ...


Go Back   Unix Technical Forum > Database Server Software > Microsoft SQL Server > MS SQL ODBC

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-27-2008, 07:32 PM
Jag Kitchens
 
Posts: n/a
Default Connecting to Access database on another computer

If I do the following, it works...

EXEC sp_addlinkedserver @server = test ,
@srvproduct = 'Jet 4.0',
@provider = 'Microsoft.Jet.OLEDB.4.0',
-- @datasrc = 'i:\test Database\Data\test.mdb',
@datasrc = 'd:apps\test Database\Data\test.mdb',
@location = NULL,
@provstr = NULL,
@catalog = NULL
GO

--Set up login mappings

EXEC sp_addlinkedsrvlogin @rmtsrvname = test,
@useself = FALSE,
@locallogin = NULL,
@rmtuser = admin,
@rmtpassword = NULL
GO
--Query one of the tables: file1#txt

SELECT *
FROM test...[tblcontacts]
GO

-- Drop server and releasing user
EXEC sp_dropserver test,'droplogins'
go

but if i change

-- @datasrc = 'i:\test Database\Data\test.mdb',
@datasrc = 'd:apps\test Database\Data\test.mdb',

to

@datasrc = 'i:\test Database\Data\test.mdb',
-- @datasrc = 'd:apps\test Database\Data\test.mdb',

where I: is a mapped path to a win 2000 computer
and test.mdb is the same database on both computers


I get the following:

Server: Msg 7399, Level 16, State 1, Procedure sp_tables_ex, Line 20
OLE DB provider 'Microsoft.Jet.OLEDB.4.0' reported an error.
[OLE/DB provider returned message: The Microsoft Jet database engine cannot
open the file 'i:\test Database\Data\test.mdb'. It is already opened
exclusively by another user, or you need permission to view its data.]

if I change
sp_addlinkedsrvlogin
to
@useself = TRUE,

then

I get the message:

Server: Msg 7303, Level 16, State 2, Procedure sp_tables_ex, Line 20
Could not initialize data source object of OLE DB provider
'Microsoft.Jet.OLEDB.4.0'.
[OLE/DB provider returned message: Not a valid account name or password.]
Server: Msg 7303, Level 16, State 2, Line 8
Could not initialize data source object of OLE DB provider
'Microsoft.Jet.OLEDB.4.0'.
[OLE/DB provider returned message: Not a valid account name or password.]


Any ideas?

Appreciated!

David Walker



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-27-2008, 07:32 PM
Mary Chipman
 
Posts: n/a
Default Re: Connecting to Access database on another computer

I haven't played with linked servers with Access for a while, but if I
recall correctly, you don't need to supply security information for
unsecured Jet databases. If your Jet database is secured, then
creating a linked server is a giant PITA that rarely works out. In an
unsecured Jet database, everyone logs on silently as the Admin user
with a blank password (empty string), which is why @useself = TRUE
didn't work (it's trying to pass your Windows or SQLS login
credentials, and since Jet doesn't support integrated security, that's
a non-starter). So try just running sp_addlinkedserver and omit
sp_addlinkedsrvlogin and see if that works.

-- Mary
MCW Technologies
http://www.mcwtech.com

On Wed, 22 Oct 2003 11:59:47 +0930, "Jag Kitchens"
<jagkitchens@chariot.net.au> wrote:

>If I do the following, it works...
>
> EXEC sp_addlinkedserver @server = test ,
> @srvproduct = 'Jet 4.0',
> @provider = 'Microsoft.Jet.OLEDB.4.0',
> -- @datasrc = 'i:\test Database\Data\test.mdb',
> @datasrc = 'd:apps\test Database\Data\test.mdb',
> @location = NULL,
> @provstr = NULL,
> @catalog = NULL
> GO
>
> --Set up login mappings
>
> EXEC sp_addlinkedsrvlogin @rmtsrvname = test,
> @useself = FALSE,
> @locallogin = NULL,
> @rmtuser = admin,
> @rmtpassword = NULL
> GO
> --Query one of the tables: file1#txt
>
> SELECT *
> FROM test...[tblcontacts]
> GO
>
> -- Drop server and releasing user
> EXEC sp_dropserver test,'droplogins'
> go
>
>but if i change
>
>-- @datasrc = 'i:\test Database\Data\test.mdb',
> @datasrc = 'd:apps\test Database\Data\test.mdb',
>
>to
>
> @datasrc = 'i:\test Database\Data\test.mdb',
>-- @datasrc = 'd:apps\test Database\Data\test.mdb',
>
>where I: is a mapped path to a win 2000 computer
>and test.mdb is the same database on both computers
>
>
>I get the following:
>
>Server: Msg 7399, Level 16, State 1, Procedure sp_tables_ex, Line 20
>OLE DB provider 'Microsoft.Jet.OLEDB.4.0' reported an error.
>[OLE/DB provider returned message: The Microsoft Jet database engine cannot
>open the file 'i:\test Database\Data\test.mdb'. It is already opened
>exclusively by another user, or you need permission to view its data.]
>
>if I change
>sp_addlinkedsrvlogin
>to
> @useself = TRUE,
>
>then
>
>I get the message:
>
>Server: Msg 7303, Level 16, State 2, Procedure sp_tables_ex, Line 20
>Could not initialize data source object of OLE DB provider
>'Microsoft.Jet.OLEDB.4.0'.
>[OLE/DB provider returned message: Not a valid account name or password.]
>Server: Msg 7303, Level 16, State 2, Line 8
>Could not initialize data source object of OLE DB provider
>'Microsoft.Jet.OLEDB.4.0'.
>[OLE/DB provider returned message: Not a valid account name or password.]
>
>
>Any ideas?
>
>Appreciated!
>
>David Walker
>
>


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-27-2008, 07:32 PM
David Walker
 
Posts: n/a
Default Re: Connecting to Access database on another computer

Nope if I remove sp_addlinkedsrvlogin code, I get

Server: Msg 7303, Level 16, State 2, Procedure
sp_tables_ex, Line 20
Could not initialize data source object of OLE DB
provider 'Microsoft.Jet.OLEDB.4.0'.
[OLE/DB provider returned message: Not a valid account
name or password.]

and no data access...

Any more Ideas?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 11:17 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com