Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Linking Sage Line 50 Data to SQL Server

Posted on 2008-06-25
5
Medium Priority
?
1,916 Views
Last Modified: 2008-07-29
How can I link to Sage Line from SQL Server so that I can copy data from a sage table into a SQL table?

I have tried the following:
1) Created a DSN using ODBC Data Source Administrator (and I am able to extract data using this from Sage into Excel)
2) Created a linked server (called SAGELINK) using sp_addlinkedserver and
3) Used sp_addlinkedsrvlogin to add security details i.e. username and password for Sage

I then try to query the SALES_LEDGER table (which I can link to in Excel) linked server such as:
SELECT * from SAGELINK...SALES_LEDGER
however I get an error message saying "Cannot initialise the data source object of LOE DB provider 'MSDASQL' fro linked server 'SAGELINK'

What am I doing wrong? Or is there another way to do this?
0
Comment
Question by:Prandeo
[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
  • 3
  • 2
5 Comments
 
LVL 13

Expert Comment

by:rickchild
ID: 21882252
Can you show me your code for sp_addlinkedserver and sp_addlinkedserverlogin ?
0
 

Author Comment

by:Prandeo
ID: 21892294
I've made some further progress. My code is
EXEC sp_addlinkedserver
@server='SAGELINK',
@srvproduct='Sage',
@provider='MSDASQL',
@datasrc='SageLocal'
Then
EXEC sp_addlinkedsrvlogin 'SAGELINK', 'false', NULL, 'manager', 'password'
I must have a link because when I query the following
EXEC sp_tables_ex @table_server='SAGELINK'
I can see all the sage tables. However when I query
select * from SAGELINK...SALES_LEDGER
I now get the error message
Msg 7314, Level 16, State 1, Line 1
The OLE DB provider "MSDASQL" for linked server "SAGELINK" does not contain the table "SALES_LEDGER". The table either does not exist or the current user does not have permissions on that table.
0
 
LVL 13

Expert Comment

by:rickchild
ID: 21943701
Yes looks like you do have a good link if you can see the tables, have you tried qualifying it a bit better

SAGELINK.[DatabaseName].dbo.SALES_LEDGER
0
 

Accepted Solution

by:
Prandeo earned 0 total points
ID: 21943762
I don't know the [Databasename] - how can I find this out?

Interestingly I've just tried the following which works:

SELECT * FROM OPENQUERY(SAGELINK, 'SELECT * FROM SALES_LEDGER')

But the simple query SELECT * FROM SAGELINK..SALES_LEDGER still gives the error:

Msg 7314, Level 16, State 1, Line 1
The OLE DB provider "MSDASQL" for linked server "SAGELINK" does not contain the table "SALES_LEDGER". The table either does not exist or the current user does not have permissions on that table.

Why?
0
 
LVL 13

Expert Comment

by:rickchild
ID: 21945031
I am guessing the OPENQUERY is working as it is using the default database, but you query with ... may not be selecting a database.

The default database may have been set up in the DSN, take a look in there.
0

Featured Post

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
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.

597 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