473,326 Members | 2,081 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Connecting to a AS400 iSeries queue from .NET

Hi,

I have been assigned to connect to a AS400 queue using the iSeries API, probably version 5 release 3. I use Visual Basic.NET in Visual Studio.NET 2003.

I would be grateful for all input regarding this problem, since I don't really have any ideas on how to start.

Questions:
1. I am not gonna connect to a database, only a queue e.g. the queue QSNDDTAQ. Are any installations required on the client as well as the server to be able to connect to the queue.

2. Can anyone provide code examples, preferrably in VB.NET but any .NET language will do?

3. Anyone know of an Internet resource I can read?

Best
/M
Oct 4 '06 #1
3 10067
Hi Mortsdeh

Did you find any solution regarding the connection to AS400 queue ?
Please let me know - I have been assigned a similar project using VB.NET.

Many Thanks
Tom



Hi,

I have been assigned to connect to a AS400 queue using the iSeries API, probably version 5 release 3. I use Visual Basic.NET in Visual Studio.NET 2003.

I would be grateful for all input regarding this problem, since I don't really have any ideas on how to start.

Questions:
1. I am not gonna connect to a database, only a queue e.g. the queue QSNDDTAQ. Are any installations required on the client as well as the server to be able to connect to the queue.

2. Can anyone provide code examples, preferrably in VB.NET but any .NET language will do?

3. Anyone know of an Internet resource I can read?

Best
/M
Oct 17 '07 #2
Hi,

the queue you are describing QSNDDTAQ is not a queue but the actual API on the AS400 which is used within OS400 to put data in a queue. A queue can be any name of 10 characters and exists in the library system of the AS400.
The queue can be fifo, lifo or keyed.
I do not have any experience with .net and how to access queues on the AS400 but I have done it in Java. I assume there are certain API's available to connect to these queues. You just need to know the exact name, libary where it exists and if it is keyed or not.
Dec 4 '07 #3
1. You have to install the Client Access for iSeries on the server executing the code.

2. Here is a example piece of code.

The connection string in the application settings My.Settings.AS400_DBConnection being in the format off
Provider=MSDASQL;DSN=ODBCNAME;UID=username;PWD=xxx xx;
where ODBCNAME is a ODBC connection you've set up using the iSeries driver.
You can of course vary what the last parameter contains ('PF<OrderID>.XML') by altering the command string and/or the replace function as well as of course the incoming parameters to the function.

Expand|Select|Wrap|Line Numbers
  1. Public Function CallAS400Queue(ByVal pOrderNumber As String) As Boolean
  2.  
  3.         'Create the ODBC objects
  4.         Dim OdbcCon As System.Data.Odbc.OdbcConnection
  5.         Dim OdbcCmd As System.Data.Odbc.OdbcCommand
  6.         Dim command As String
  7.         Try
  8.             command = "call qsys.qsnddtaq ('EMAIL     ','QGPL      ',X'00030F','PF<OrderID>.XML')"
  9.             command = command.Replace("<OrderID>", pOrderNumber)
  10.  
  11.             'Instantiate new instances
  12.             OdbcCon = New System.Data.Odbc.OdbcConnection
  13.  
  14.             'Open a connection to an iSeries data source       
  15.             OdbcCon.ConnectionString = My.Settings.AS400_DBConnection
  16.             'Open the connection
  17.             OdbcCon.Open()
  18.  
  19.             OdbcCmd = New System.Data.Odbc.OdbcCommand(command, OdbcCon)
  20.  
  21.             Try
  22.                 OdbcCmd.ExecuteNonQuery()
  23.             Catch oException As Exception
  24.                 Throw oException
  25.             Finally
  26.                 'close the connection
  27.                 OdbcCon.Close()
  28.                 OdbcCon.Dispose()
  29.             End Try
  30.         Catch oException As Exception
  31.             Throw oException
  32.         End Try
  33.         Return True
  34.     End Function
  35.  
Dec 11 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Jim | last post by:
Hi Folks, We have a DB2 database on a WAN at work. I want to access the database from some Visual Basic for Applications code that I have written at work. The database itself is not directly...
3
by: Laurence | last post by:
Hi there, Does somebody know the efficent way to connect DB2/400? Through iSeries Access ODBC/OLEDB driver or DB2 Connect? Which will more fast and efficent? In addition, does DB2 Connect use...
0
by: mortenol | last post by:
Hi, I am trying to connect a MS SSIS package to an AS400/DB2 database, and I experience problem when I hit the "Create Package" button in the "Data Link properties window". I have understood that...
3
by: Russ | last post by:
My company is running DB2 on AS400 iSeries V5R3 and making a strong push to move from RPG/External stored procs to SQL stored procs. My background is Oracle/SQL Server and am used to using some...
3
by: Jeff Allan | last post by:
Hello, Does anyone out there have experience with connectivity to DB2 hosted on an iSeries? I have successfully written a VB.NET 2005 WEB application to do this but I am having a morning...
1
by: Chevylover54 | last post by:
We have been using ODBC connections that are in the registry of the computer. However these connections aren't in by default so when a new user uses the Access program or when a current user goes to...
6
by: Al G | last post by:
Can someone tell me what I need to get connected to our AS400? I am trying to write an app in VS2005(Data source, Gridview) that requires data from files on our AS400. I've downloaded DB2, and...
1
by: Richard2000 | last post by:
Hi team, Has anyboby faced this issue? I'm trying to use db2move to export as400 schema content to my local windows file system. The aim is to be able to re-import it into a DB2 UDB v9 Windows...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.