Solved

Linking Sage Line 50 Data to SQL Server

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

Increase Agility with Enabled Toolchains

Connect your existing build, deployment, management, monitoring, and collaboration platforms. From Puppet to Chef, HipChat to Slack, ServiceNow to JIRA, Splunk to New Relic and beyond, hand off data between systems to engage the right people.

Connect with xMatters.

Question has a verified solution.

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

Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
I have a large data set and a SSIS package. How can I load this file in multi threading?
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…
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.

691 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