Solved

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

Posted on 2006-07-01
6
761 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
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.

867 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