Groups | Blog | Home
all groups > sql server connect > october 2003 >

sql server connect : Can't connect to another computer!


David Walker
10/28/2003 3:19:07 PM
If I do the following, it works...

EXEC sp_addlinkedserver @server = test ,
@srvproduct = 'Jet 4.0',
@provider = 'Microsoft.Jet.OLEDB.4.0',
-- @datasrc= '\\computer\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 = '\\computer\test Database\Data\test.mdb',
@datasrc = 'd:apps\test Database\Data\test.mdb',

to

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

where computer 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 '\\computer\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



David Walker
10/28/2003 11:36:59 PM

[quoted text, click to view]

I have tried using UNC code, see original script
ie \\computer\apps\test.mdb
and i still get the same error.
(the "d" mapping is a local drive that works!)

- I have read a couple of articals that may suggest that
i change the default system.mdw file in the registry
(Knowledge base article Q246255)

Has anyone tried this and succeeded?
anyone got any other ideas?
Steve
10/29/2003 1:01:46 AM
David,

I'm having a very similar problem to this. I can create a
linked server and access the data on the machine that SQL
resides - but not remotely.

Like you, I have tried the variations on creating the
linked server, and added logins, with no noticeable
difference.

I would have thought that you would only need to change
the default system.mdw file if the database you were
trying to access was secured. Mine isn't.

I'll post again if I find out anymore.

Cheers

Steve

rboyd NO[at]SPAM onlinemicrosoft.com
10/29/2003 4:24:29 AM
Since with a linked server, the SQL Server startup account is making the
connection. Using drive letter designations will not reliably work. It is
best to use UNC for access to remote shares.

Rand
This posting is provided "as is" with no warranties and confers no rights.
Steve
10/29/2003 5:53:09 AM
David,

I have been trying to sort out my own problem with this. I
changed the registry setting for the system.mdw file. it
made no difference.
[quoted text, click to view]
rboyd NO[at]SPAM onlinemicrosoft.com
10/30/2003 12:25:19 AM
Sorry I misunderstood. If you log into the SQL Server machine using the SQL
Server startup account can you access the Access file on the remote machine?

Rand
This posting is provided "as is" with no warranties and confers no rights.
davidw
10/30/2003 4:09:24 PM
I have changed the SQL Server startup account to a local
and remote administrator level account,

then logged into the local NT SQL server computer as this
account, found that i can open the remote mdb file using
msaccess.

re-run SQL query using this account - still no valid
connection.

IE same error as before.

any more ideas?

Thanks for helping
Dave
Steve
10/31/2003 5:14:03 AM
David, this problem has been driving me up the wall. But I
think I have cured it. First some background. I'm
developing a system, my PC runs Win2K. I install the
updates to another PC running NT4 workstation - Linked
server doesn't work.

I've installed the database on the company server -
running Win2K server - and my problem has gone away.

I've tried all of the options that have been suggested by
various people but with no luck.

Try the following link
http://support.microsoft.com/default.aspx?scid=kb;en-
us;241267

Also, try adding all users to your unc share and give them
all full control.

You may have tried these already, if not it may be worth
looking at.

Also, try this link
http://msdn.microsoft.com/library/default.asp?
url=/library/en-us/adminsql/ad_1_server_4uuq.asp

Good luck.
Steve
[quoted text, click to view]
AddThis Social Bookmark Button