Solved

Linking Sage Line 50 Data to SQL Server

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

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

Suggested Solutions

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
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
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
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.

756 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