Is there a way to access a DB2 database on an AS/400 with ASP? I'd like to be able to have my users create queries on the web browser then execute those on a DB2 database on an AS/400 box.
Any ideas are greatly appreciated.
set rs=server.CreateObject("ADODB.Recordset"
sub ExecuteSQL(byval cmd)
if rs.State=1 then rs.Close
rs.CursorType = adOpenStatic
rs.CursorLocation = adUseClient
rs.LockType = adLockPessimistic
rs.Source = cmd
rs.ActiveConnection = Connection 'The record set needs to know what connection to use.
rs.Open
end sub
...
SQL="select * from MyDatabaseName"
ExecuteSQL(SQL)
RecNo=rs.RecordCount
...
Thanks for your reply. I must admint that I'm a beginner to ASP and I was wondering if there was some sample code I could use. Where would I put this code on the asp page?
The OS/400 programmer created a test DB called SAMPLEDB2 on the DEVLIB library and added some dummy data to play with. I imagine I can add that info in the DBQ= section, right?
I appreciate your help on this problem.
I'm running IIS 4 on an NT 4 server. All SPs loaded.
I can use them, but I need to access the IBM DB2 database instead. My company's main DB system runs on our AS/400 and we use DB2 instead of MS-SQL.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.