Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 23rd, 2005, 05:04 PM
Registered User
 
Join Date: Feb 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default SQL Server connection to IBM AS/400

Hi. I'm a beginner with SQL Server.
I want to create a stored procedure (sp) on our SQL server that will access our IBM AS/400 and retrieve data from it. I don’t want to copy the data and store it on the server. I will be using a .Net (C#) application to call this sp to get the data and return it to the .Net app. Any ideas? Thanks, Robert



 
Old February 24th, 2005, 12:01 AM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 625
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to jemacc
Default

You can create a linked server to the AS/400 and use open query to select or move your data.

Jaime E. Maccou
 
Old February 24th, 2005, 04:30 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

look in the archive http://p2p.wrox.com/topic.asp?TOPIC_ID=26411
 
Old February 24th, 2005, 05:52 PM
Registered User
 
Join Date: Feb 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you for your responses. 26411 was helpful but I'm not sure how to create a System ODBC connection. Go into Client Access, ODBC Data Source Administrator, under General tab - Data source name: AS400, Description: Client Access Express ODBC data source, AS/400 system: (our IP address). Is this correct? Then on the SQL server, linked server properties, I don't know what to put in Product name, data source, provider string, location, and catalog. I user AS400 as the data source name but got the error: error 7399: OLE DB provider 'MSDASQL' reported an error. Data source name not found and no default driver specified] OLE DB error trace [OLE/DB Provider 'MSADSQL' IDBInitialize::Initialize returned 0x80004005: ]. What next?

 
Old February 25th, 2005, 05:09 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

DSN setup:
General Tab, System drop-down - I just get a list of AS400 names in this drop-down and I choose one of those. Also click the Connection Options to make sure it isn't sending a windows id by default (use "None" or specify a specific AS400 id)

Server Tab - make sure the naming convention is SQL not system. I also change the default library to be the one that contains the files I want to access, but that's not essential.

Performance Tab - I always have "lazy close" and "compression" checked

Linked Server setup:
All you need is the name of the DSN in the "Data source". Product name, provider string, location, and catalog are just left blank.

hth
Phil
 
Old February 25th, 2005, 05:54 PM
Registered User
 
Join Date: Feb 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks, Phil. I'm getting the same error message. What I am forgetting?

 
Old February 28th, 2005, 06:32 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

Are you trying to set this up on a remote or local SQL Server? On which server did you set up the DSN?
 
Old March 1st, 2005, 03:38 PM
Registered User
 
Join Date: Feb 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Phil. I found out that our sql server doesn't have Client Access/ODBC Admin on it. So I tried it from my local version to the as400 and it worked. Thanks for your help.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Connection to SQL Server brijxp ADO.NET 1 November 18th, 2006 08:34 AM
Access DB2 on AS/400 using IBM OLE DB Provider KiwiMark SQL Server 2005 2 February 16th, 2006 07:40 PM
Connecting to AS/400 from SQL SERVER vakula SQL Server 2000 1 February 3rd, 2005 06:33 AM
SQL Server Connection mpeterson Classic ASP Databases 1 July 8th, 2003 09:50 PM
Connection with sql server arshad mahmood VB Databases Basics 1 June 19th, 2003 10:53 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.