|
|
 |
| 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.
|
 |

February 9th, 2005, 07:29 PM
|
|
Registered User
|
|
Join Date: Feb 2005
Location: Scottsdale, AZ, USA.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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.
|

February 12th, 2005, 02:03 AM
|
|
Friend of Wrox
|
|
Join Date: Nov 2003
Location: Lehigh Acres, FL, USA.
Posts: 625
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Can you be more descriptive of your task?
Jaime E. Maccou
|

February 14th, 2005, 11:37 AM
|
|
Registered User
|
|
Join Date: Feb 2005
Location: Scottsdale, AZ, USA.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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?
|

February 14th, 2005, 02:48 PM
|
|
Authorized User
|
|
Join Date: Jul 2004
Location: cleveland, oh, USA.
Posts: 66
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|

February 15th, 2005, 05:47 PM
|
|
Registered User
|
|
Join Date: Feb 2005
Location: Scottsdale, AZ, USA.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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?
|

February 16th, 2005, 05:16 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Location: , , United Kingdom.
Posts: 1,212
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|

February 16th, 2005, 09:55 AM
|
|
Authorized User
|
|
Join Date: Jul 2004
Location: cleveland, oh, USA.
Posts: 66
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|

February 16th, 2005, 10:41 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Location: , , United Kingdom.
Posts: 1,212
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
OIC, you use OPENQUERY to actually get the data. That's v useful, thanks, and it does seem to be quicker too
|

October 2nd, 2009, 12:22 PM
|
|
Registered User
|
|
Join Date: Oct 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
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
|
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
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 |
|
 |