Solved

Newbie Urgent Question on connecting from SQL Server Express 2005 to MS Access

Posted on 2006-07-01
6
768 Views
Last Modified: 2012-05-05
Basic but urgent question... I've got SQL Server Express locally on my workstation. I also have an MS Acces database locally on my workstation. From SQL Server, I must run a series of SELECT statements against the Access database. I understand from the docs and online that I need to have a linked server. Apparently, I'm not getting the syntax right, however.

The MS Access DB has no security. The workstation user is 'Tom.'

The error I get on the 2nd statement below is:
Msg 15007, Level 16, State 1, Procedure sp_addlinkedsrvlogin, Line 76
'Tom' is not a valid login or you do not have permission.


EXEC sp_addlinkedserver
@server = 'pcf'
, @Srvproduct = 'Access'
, @Provider = 'Microsoft.Jet.OLEDB.4.0'
, @datasrc = 'C:\mydata\Tom01JUL.mdb'
GO

sp_addlinkedsrvlogin 'pcf', false, 'Tom', 'Admin', NULL;

SELECT code
FROM pcf...shift
GO

Though not difficult, there's a level of urgency on this, so thus the higher point ranking.
0
Comment
Question by:DataDesignIT
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 17024484
change the provider to

   @provider = 'Microsoft.Jet.OLEDB.4.0',
 
0
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 17024485
Sorry wrong post
0
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 17024488
i mean the server product to

   @srvproduct = 'OLE DB Provider for Jet'

0
Free eBook: Backup on AWS

Everything you need to know about backup and disaster recovery with AWS, for FREE!

 

Author Comment

by:DataDesignIT
ID: 17024502
I  changed the server name, since pcf already existed, and ran the following:

EXEC sp_addlinkedserver
@server = 'pcf1'
, @srvproduct = 'OLE DB Provider for Jet'
, @Provider = 'Microsoft.Jet.OLEDB.4.0'
, @datasrc = 'C:\mydata\Tom01JUL.mdb'
GO


I still got the same Msg 15007 on the next line:
   sp_addlinkedsrvlogin 'pcf1', false, 'Tom', 'Admin', NULL

0
 
LVL 75

Accepted Solution

by:
Aneesh Retnakaran earned 500 total points
ID: 17024515


sp_addlinkedsrvlogin 'pcf', false, 'sa', 'Admin', NULL; -- do you have a username 'Tom' in the sql server ... i changed to 'sa'
0
 

Author Comment

by:DataDesignIT
ID: 17024561
YIPEE! Thanks. I'm in! I didn't have a 'Tom' user in the SQL Server.
0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SQL Sum of items in two tables not equal. 5 49
Parsing this XML works but the other one doesn't 9 30
SQL Server Sum Over Multiple Tables 20 33
T-SQL Query - Group By Year 3 31
When you hear the word proxy, you may become apprehensive. This article will help you to understand Proxy and when it is useful. Let's talk Proxy for SQL Server. (Not in terms of Internet access.) Typically, you'll run into this type of problem w…
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question