Showing posts with label provider. Show all posts
Showing posts with label provider. Show all posts

Monday, March 19, 2012

How to create a SAPConnection in .Net Code with .NET Data Provider

In the SQL Server Technical Article Microsoft .NET Data Provider for mySAP? Business Suite

is a Code example of how to invoke a BAPI in .Net Code. First line shows how to create a Connection to SAP, but there is no information in which lib the SAPConnection type is stored:

SAPConnection con = new SAPConnection("ASHOST=<SAPserver>; CLIENT=<client>;SYSNR=<sysnr>;USER=<user>;PASSWD=<password>;LANG=<logon

language>");
con.Open();

Does somebody can help me?Assembly Microsoft.Adapter.SAP.SAPProvider|||Correct! That really helped me out! Thanks.

Monday, March 12, 2012

How to create a linked server to MySQL from MsSQL?

I can create a linked server to another MsSQL from MsSQL,but encounter error when create a linked server to MySQL:
Error 7399:OLE DB provider 'MSDASQL' reported an error.
Data source name not found and no default driver specified.
.....
Anyone can help me?
Thanks!try this step,

1. Installed MyODBC driver version for windows,u can download from mysql site
2. Create a system ODBC DSN using this driver to a specific server and database.

3. In SQL Server 2K Enterprise Manager, created a linked server using Microsoft OLE DB Provider for ODBC Drivers and specified the DSN in the Data Source.

and select query should be,

SELECT * FROM OPENQUERY(linkedservername, 'database.table')

or

SELECT * FROM OPENQUERY(linkedservername, 'select * from table)

--cheers,
--http://mallier.blogspot.com|||Yes,I did as you said.But still get this error.

The setting are:
Server Type:Microsoft OLE DB Provider for ODBC
DataSource:mydsn
Provider string:DATABASE=mydb;DSN=mydsn;SERVER=myserver;UID =myuid;PWD=mypwd
Location:myserver
Catalog:mydb

Something is wrong?|||I dont have Mysql here,
try this,

Server Type:Microsoft OLE DB Provider for ODBC
DataSource:mydsn

and remove other properties.

--cheers,
--http://mallier.blogspot.com|||Even I linked to the MsSQL server NOT MySQL,
if put myserver in data source,it's ok.
but if put mydsn in data source,it got same error.|||Sorry,I created dns in wrong location.
After I corrected this mistake,linking to MsSQL is ok,but encountered not responding when link to MySQL.(I've verified that the dsn is ok.)|||I've fixed this problem,it's due to I didn't enable root access from remote machines.
Thanks.