r
key;CHARSET=;ROLE=;"
END SUB
''***************************************************
'' Termina Conex?o com a Base de Dados
'' Elaborado por: Cleber - 10/11/2002
''***************************************************
SUB aspDesconecta (oConex)
oConex.Close
oConex = Empty
END SUB
%>
/*-----------------*---------------------/
2o case - used Page to order the value of input and to return the value from
output of procedure procedure;
(This is problem in this page! e only when use executes procedure;
inportante to notice that the values ordered in input are recorded in the
bank that executes procedure and in the return the page for some reason ib6
does not obtain to pass value of return for asp)
<%
'*********************************************************
'Action de test.asp '
'*********************************************************
Option Explicit
SetLocale("pt-br")
%>
<!--#include file="conecta.asp"-->
<%
Dim sSQL, oRec, nResult, oConn
'' Abre conex?o com o banco
call aspConecta(oConn)
Set oRec = Server.CreateObject("ADODB.Recordset")
with oRec
.ActiveConnection = oConn
sSQL = "EXECUTE PROCEDURE dept_budget (100)"
[[[LINE 25]]]-> .Open sSQL
oRec.Open sSQL
nResult = oRec("TOT")
oRec.Close
response.write nResult
end with
response.write("ok")
aspDesconecta(oConn)
set oRec = nothing
set oConn = nothing
%>
/-----------------------------*-----------------------------------/
3o in case that - Same page used above in the case 2o that using selct of
one procedure or either only backwards information, functions
perfeitamente;(This is problem I only assume only happens when I have that
it orders a value to get another one case 2o;)
I am not being able to get the value of TOT that comes from the bank;
When I twirl asp it returns:
Tipo de erro:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[XTG Systems][InterBase6 ODBC Driver], message length error (encountered 0,
expected 59)
/test.asp, line 25
end when I execute the store procedure direct in ib it shows the result
------ Performance info ------
Prepare time = 0ms
Execute time = 0ms
Current memory = 2.978.684
Max memory = 3.100.656
Memory buffers = 2.048
Reads from disk to cache = 0
Writes from cache to disk = 2
Fetches from cache = 118
Procedure executing results:
TOT = 7900000
Because st functions in the bank but it does not function in asp?
What to make to get the value of TOT in asp?
Grateful for the attention,
Cleber
*********************************
Hi, I have the following problem:
How I make to return a content from one stored procedure of the IB6 for asp?
End as to catch in asp the return of stored procedure?
I will use the bank standard of interbase to explain my necessity:
employee.gdb
/-------------------*-------------------/
1o case - Connecting with the bank it saw odbc; (this functioning perfectly,
therefore I obtain you bring given of table saw select but I of not obtain
you bring the dates of one procedure) Code used for connection with the
bank.
Conecta.asp
<%
''***************************************************
'' Cria Conex?o com a Base de Dados
'' Elaborado por: Cleber - 10/11/2002
''***************************************************
SUB aspConecta (oConex)
set oConex = Server.CreateObject("ADODB.Connection")
oConex.open "DRIVER={XTG Systems InterBase6 ODBC
driver};DB=LocalHost:C:\Program
Files\Borland\InterBase\examples\Database\employee.gdb;UID=SYSDBA;PWD=master
key;CHARSET=;ROLE=;"
END SUB
''***************************************************
'' Termina Conex?o com a Base de Dados
'' Elaborado por: Cleber - 10/11/2002
''***************************************************
SUB aspDesconecta (oConex)
oConex.Close
oConex = Empty
END SUB
%>
/*-----------------*---------------------/
2o case - used Page to order the value of input and to return the value from
output of procedure procedure;
(This is problem in this page! e only when use executes procedure;
inportante to notice that the values ordered in input are recorded in the
bank that executes procedure and in the return the page for some reason ib6
does not obtain to pass value of return for asp)
Test.asp
<%
'*********************************************************
'Action de test.asp '
'*********************************************************
Option Explicit
SetLocale("pt-br")
%>
<!--#include file="conecta.asp"-->
<%
Dim sSQL, oRec, nResult, oConn
'' Abre conex?o com o banco
call aspConecta(oConn)
Set oRec = Server.CreateObject("ADODB.Recordset")
with oRec
.ActiveConnection = oConn
sSQL = "EXECUTE PROCEDURE dept_budget (100)"
[[[LINE 25]]]-> .Open sSQL
oRec.Open sSQL
nResult = oRec("TOT")
oRec.Close
response.write nResult
end with
response.write("ok")
aspDesconecta(oConn)
set oRec = nothing
set oConn = nothing
%>
/-----------------------------*-----------------------------------/
3o in case that - Same page used above in the case 2o that using selct of
one procedure or either only backwards information, functions
perfeitamente;(This is problem I only assume only happens when I have that
it orders a value to get another one case 2o;)
Test.asp
<%
'*********************************************************
'Action de test.asp '
'*********************************************************
Option Explicit
SetLocale("pt-br")
%>
<!--#include file="conecta.asp"-->
<%
Dim sSQL, oRec, aResult, nResult, oConn,i
'' Abre conex?o com o banco
call aspConecta(oConn)
Set oRec = Server.CreateObject("ADODB.Recordset")
with oRec
.ActiveConnection = oConn
sSql ="select CODE from ALL_LANGS"
.Open sSQL
If not .Eof then
aResult = .getrows
nResult = uBound(aResult,2)
else
aResult = null
nResult = -1
end if
oRec.Close
end with
for i= 0 to nResult
response.write aResult(0,i)&"<br>"
next
response.write("ok")
aspDesconecta(oConn)
set oRec = nothing
set oConn = nothing
%>
/----------------------------*------------------------------------/
I do not obtain to return the value from TOT of the bank;
When executing asp in the case 2o it shows the following message:
Tipo de erro:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[XTG Systems][InterBase6 ODBC Driver], message length error (encountered 0,
expected 59)
/test.asp, line 25
When executing asp in the case 3o it shows the result that I shortened
manualmnet not to be very long:
CEO
CEO
CEO
CEO
CEO
=====
CFO
CFO
CFO
CFO
CFO
=====
VP
VP
VP
VP
VP
=====
.
.
.
when I execute store procedure direct in the bank the shown result this
certainty.
------ Performance info ------
Prepare time = 0ms
Execute time = 0ms
Current memory = 2.978.684
Max memory = 3.100.656
Memory buffers = 2.048
Reads from disk to cache = 0
Writes from cache to disk = 2
Fetches from cache = 118
Procedure executing results:
TOT = 7900000
Because it executes it of store procedure functions in the bank and it does
not function in asp?
What to make to get the value of TOT in asp?
Grateful for the attention,
Cleber