Solved

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

Posted on 2006-07-01
6
759 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
  • 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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

I wrote this interesting script that really help me find jobs or procedures when working in a huge environment. I could I have written it as a Procedure but then I would have to have it on each machine or have a link to a server-related search that …
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

705 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now