Solved

Linking Sage Line 50 Data to SQL Server

Posted on 2008-06-25
5
1,868 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
  • 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

758 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

18 Experts available now in Live!

Get 1:1 Help Now