DB2 Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesDB2 Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 17th, 2009, 12:46 AM
mgsmario mgsmario is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2009
Posts: 1 mgsmario User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m
Reputation Power: 0
Struggling with db2 (Express C/9.0.5) and ASP application

Hi Guys

I have an ASP application that connects to an Oracle database, right now I'm trying to connect this same ASP application to a DB2 database (Express-C, version 9.5.0).

I'm in the process of trying to translate all the programing withing asp pages, so, can interact smoothly with db2.

Now, I have problems trying to use a stored procedure (db2) and call it from my asp application.

Here's part of my procedure:

CREATE PROCEDURE Y
(IN P1 VARCHAR(10), IN P2 SMALLINT, IN P3 DATE, OUT P4 CHAR)

Here's my asp page:

Code:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
'Establish the connection
'strConn = "DSN=mgs;UID=db2admin;PASSWORD=xxx"
strConn = "Provider=IBMDADB2.DB2COPY1; DSN=mgs; UID=MARIO GONZALEZ; PWD=marito"
Set Conn=Server.CreateObject("ADODB.Connection")
Conn.Open strConn

'Define the command object
Set Cmd=Server.CreateObject("ADODB.Command")
Cmd.ActiveConnection = Conn
Cmd.CommandText = "CALL Y"
Cmd.CommandType = 1
Cmd.Parameters.Refresh
Cmd.Properties.Refresh

'Create and append the parameters
Cmd.Parameters.Append Cmd.CreateParameter("P1",200,1,10)
Cmd.Parameters.Append Cmd.CreateParameter("P2",2,1,0)
Cmd.Parameters.Append Cmd.CreateParameter("P3",133,1,0)

'Set the parameter values
Cmd("P1")="A"
Cmd("P2")=1
Cmd("P3")="01/01/2005"

Cmd.Parameters.Append Cmd.CreateParameter("P4",200,2,1)

'Execute the "CALL" statement for the procedure. ADO 'constructs the CALL statement
set rs1=Cmd.Execute

'Free the recordset
set rs1=nothing

'Display the results
response.write "<HTML>"
response.write cmd(1)
response.write "<BR>"
response.write cmd(2)
response.write "</HTML>"

'Close the connection
Conn.Close
set Conn=nothing
%>


And here's the error on IE:

Error Type:
IBM OLE DB Provider for DB2 (0x80004005)
[DB2/NT] SQL0440N No authorized routine named "Y" of type "PROCEDURE" having compatible arguments was found. SQLSTATE=42884
/db2/test3.asp, line 30 (set rs1=Cmd.Execute)

Any thoughts?

Thanks

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesDB2 Development > Struggling with db2 (Express C/9.0.5) and ASP application


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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 On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump




 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 




© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 2 Hosted by Hostway
Stay green...Green IT