p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 9th, 2005, 07:29 PM
Registered User
Points: 14, Level: 1
Points: 14, Level: 1 Points: 14, Level: 1 Points: 14, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Feb 2005
Location: Scottsdale, AZ, USA.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default AS/400

Has anyone used SQL Server to make a real time request or update to an AS/400?

Right now my organization communicates with an AS/400 through a scheduled job of a DTS package on SQL Server 2000, to push and pull data. We'd like to do this real time.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old February 12th, 2005, 02:03 AM
Friend of Wrox
Points: 1,335, Level: 14
Points: 1,335, Level: 14 Points: 1,335, Level: 14 Points: 1,335, Level: 14
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2003
Location: Lehigh Acres, FL, USA.
Posts: 625
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to jemacc
Default

Can you be more descriptive of your task?

Jaime E. Maccou
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #3 (permalink)  
Old February 14th, 2005, 11:37 AM
Registered User
Points: 14, Level: 1
Points: 14, Level: 1 Points: 14, Level: 1 Points: 14, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Feb 2005
Location: Scottsdale, AZ, USA.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Id like to read from or update an AS/400 file (or table, or whatever their called) from an SQL Server stored procedure in real time. Or write a web service to do it.

From SQL Server, is a Linked Server my only option. If so, what are the linked server properties?

From a web service, what would be the connection string?

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #4 (permalink)  
Old February 14th, 2005, 02:48 PM
Authorized User
Points: 164, Level: 3
Points: 164, Level: 3 Points: 164, Level: 3 Points: 164, Level: 3
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2004
Location: cleveland, oh, USA.
Posts: 66
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Setting up AS400 linked server:

If you plan to update the AS400 Journaling must be turned on

Create a System ODBC connection, use an AS400 login whose password doe not expire preferably. Using the Client Access ODBC driver.

in enterprise manager under security/linked servers

Right click and ADD

Specify a name for your AS400, I call mine simply AS400

select MS OLEDB for ODBC driver

IN data source specify the System Datasource set up previously

click the provider option button, check all but level zero

click the security tab and put in the AS400 user and password you want to use

under server option check all but collation compatible.

I'm not quite sure what all that does but it took me 3 months to figure it out.

David
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #5 (permalink)  
Old February 15th, 2005, 05:47 PM
Registered User
Points: 14, Level: 1
Points: 14, Level: 1 Points: 14, Level: 1 Points: 14, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Feb 2005
Location: Scottsdale, AZ, USA.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks David. Using your instructions I was able to create the Linked Server. I expand the tree I created and see tables and views. But if I try to write a sql statement (like, select * from as400_s...DRW), the message returns:

Server: Msg 7313, Level 16, State 1, Line 1
Invalid schema or catalog specified for provider 'MSDASQL'.
OLE DB error trace [Non-interface error: Invalid schema or catalog specified for the provider.].

Any suggestions?

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #6 (permalink)  
Old February 16th, 2005, 05:16 AM
Friend of Wrox
Points: 2,450, Level: 20
Points: 2,450, Level: 20 Points: 2,450, Level: 20 Points: 2,450, Level: 20
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: , , United Kingdom.
Posts: 1,212
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I tried this out and could only get it working by:
- in provider option button, unchecking 'Index as Access Path'
- in SQL using SELECT * FROM <<LinkedServer>>.<<AS400Name>>.<<AS400Library>>.<< AS400File>>

hth
Phil
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #7 (permalink)  
Old February 16th, 2005, 09:55 AM
Authorized User
Points: 164, Level: 3
Points: 164, Level: 3 Points: 164, Level: 3 Points: 164, Level: 3
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2004
Location: cleveland, oh, USA.
Posts: 66
Thanks: 0
Thanked 0 Times in 0 Posts
Default

that is useing 4 part naming, but is unefficient from what I have read.

here is a sample of how to use OPENQUERY

select * from openquery(as400,'
select * from library.tablename
where
charfield = ''some char value'' and
numfield = 2
')

the AS400 select statement must be enclosed in single quotes, any char values must be within double single quotes, numeric values no quotes.

the AS400 after the OPENQUERY is the name of your linked server, mine is simply named AS400

I usually format my openquery statements as above, makes it simple to understand (for me)

David



Quote:
quote:Originally posted by pgtips
 I tried this out and could only get it working by:
- in provider option button, unchecking 'Index as Access Path'
- in SQL using SELECT * FROM <<LinkedServer>>.<<AS400Name>>.<<AS400Library>>.<< AS400File>>

hth
Phil
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #8 (permalink)  
Old February 16th, 2005, 10:41 AM
Friend of Wrox
Points: 2,450, Level: 20
Points: 2,450, Level: 20 Points: 2,450, Level: 20 Points: 2,450, Level: 20
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: , , United Kingdom.
Posts: 1,212
Thanks: 0
Thanked 0 Times in 0 Posts
Default

OIC, you use OPENQUERY to actually get the data. That's v useful, thanks, and it does seem to be quicker too
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #9 (permalink)  
Old October 2nd, 2009, 12:22 PM
Registered User
Points: 3, Level: 1
Points: 3, Level: 1 Points: 3, Level: 1 Points: 3, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default SQL SERVER Linked Server to AS400

IF I create code in .NET with this parameters I make a success full connection to AS400:

conexion.ConnectionString = " DataSource=10.254.xxx.xxx;DataBase=S1018689;UserId =yyy;Password=zzz";

mySqlString.Append("SELECT * FROM LIBRARY.TABLE");
conexion.Open();

iDB2Command command = new iDB2Command(mySqlString.ToString());

command.CommandTimeout = 0;
command.Connection = conexion;

iDB2DataAdapter SqlDa = new iDB2DataAdapter(command);

DataSet DS = new DataSet();
SqlDa.Fill(DS);

The question is: when I run de create linked server wizard it ask me for some info, and I don’t know what to put where.

@srvproduct = ?
@datasrc = ?
@provstr = ?
@catalog = ?



Quote:
Originally Posted by dhay1999 View Post
Setting up AS400 linked server:

If you plan to update the AS400 Journaling must be turned on

Create a System ODBC connection, use an AS400 login whose password doe not expire preferably. Using the Client Access ODBC driver.

in enterprise manager under security/linked servers

Right click and ADD

Specify a name for your AS400, I call mine simply AS400

select MS OLEDB for ODBC driver

IN data source specify the System Datasource set up previously

click the provider option button, check all but level zero

click the security tab and put in the AS400 user and password you want to use

under server option check all but collation compatible.

I'm not quite sure what all that does but it took me 3 months to figure it out.

David
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter11 page 400 asplundo BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 0 February 18th, 2008 09:29 AM
What Is Error 400? RollingWoodFarm Excel VBA 3 January 2nd, 2007 03:07 PM
New solution to connect AS/400 from VB6 viethan505 SQL Server 2000 0 August 22nd, 2006 05:25 AM
error 400 davidspeare Beginning VB 6 1 October 1st, 2005 03:40 PM
XML & AS/400 jmariani XML 1 November 7th, 2003 04:01 AM



All times are GMT -4. The time now is 03:39 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc