Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > ASP and AS/400

Reply
Thread Tools

ASP and AS/400

 
 
Jack
Guest
Posts: n/a
 
      11-29-2003
Hi,

Using VbScript in an ASP page, I want to access a database stored on the
AS/400. Should I use ADO, ODBC or anyother way of doing it?

And is it possible to have some sample codes?

Thanks

Jack


 
Reply With Quote
 
 
 
 
Ray at
Guest
Posts: n/a
 
      11-29-2003
Treat it just like any other data source. If you have OLEDB drivers for
DB2, use them. If you only have ODBC, use them. IBM's Client Access [even
Express] comes with both, and you can choose to just install the drivers on
your IIS server without installing the full CA application. One of the only
things I know to watch out for is to never end your queries with a ;. And
just think LIBRARY=database, FILE=table. Here is sample code using IBM's
OLEDB drivers:




Function ReturnCIFArray(BankNumber, JulianDate)


sDB2String = "Provider=IBMDA400.DataSource.1;Persist Security
Info=False;User ID=AnAS400UserID;Password=ValidPassword;Data
Source=HOST_NAME_OR_AS_400_IP_ADDRESS;Catalog Library
List=LIBRARY1,LIBRARY2,LIBRARY3"

sDB2SQL = sDB2SQL & "SELECT LIBRARY1.FILE1.MEMBER1 FROM LIBRARY1.FILE1
WHERE LIBRARY1.FILE1.MEMBER2='some value'"

Set oDB2ADO = Server.CreateObject("ADODB.Connection")
oDB2ADO.Open sDB2String

Set SomeRecordset = oDB2ADO.Execute(sDB2SQL)
If Not SomeRecordSet.EOF Then TheResults = SomeRecordSet.GetRows()
SomeRecordSet.Close : Set SomeRecordSet = Nothing
oDB2ADO.Close
Set oDB2ADO = Nothing

Fully qualifying the files isn't necessary if you're only looking in one
library, but for illustration purposes, I qualified them and included a
library list in the connection string.

Ray at work


"Jack" <(E-Mail Removed)> wrote in message
news:lqRxb.359$(E-Mail Removed)...
> Hi,
>
> Using VbScript in an ASP page, I want to access a database stored on the
> AS/400. Should I use ADO, ODBC or anyother way of doing it?
>
> And is it possible to have some sample codes?
>
> Thanks
>
> Jack
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
global filter to redirect asp (old asp!) pages on asp.net site Daves ASP .Net 2 05-31-2006 08:33 AM
2.0: asp:Menu, asp:XmlDataSource, asp:PlaceHolder R.A.M. ASP .Net 1 03-29-2006 07:55 AM
[ASP.NET1.1]Should I kill the ASP.NET worker process after recompilingmy ASP.NET webservice? Andrea Raimondi ASP .Net 1 02-06-2006 08:10 AM
ASP.Net cookie -> ASP -> ASP.Net Ben ASP .Net 3 05-28-2004 03:35 PM
LOOP through an ASP form's pages (not ASP.NET - ASP classic) David A. Beck ASP General 10 04-13-2004 05:38 PM



Advertisments