November 9th, 1999, 12:06 PM
Please look at this code
private Sub ok_Click()
'here I create my connections vars with RDO
Dim Cn as new rdoConnection
Dim Qy as new rdoQuery
Dim rs as rdoResultset
Dim str as string
'here I set my vars and establish the connection
With Cn
.Connect = "DSN=PRO; UID=" & uid.Text & " ; PWD=" & pwd.Text & ";"
.EstablishConnection rdDriverNoPrompt, false
End With
'till here no problem, the connection is established
'I set the actiove connection for my query
set Qy.ActiveConnection = Cn
'the query is a call to a Oracle8 stored procedure that has 1 param as
' input(a string) and returns an integer
str = "{? = Call claudiaa (?)}"
Qy.sql = str
'now <i should set the properties and the values of the params
Qy.rdoParameters(0).Direction = rdParamReturnValue
Qy(1) = "xyx"
set rs = Qy.OpenResultset()
rs.Close
Cn.Close
Exit Sub
End Sub
What's wrong is the settings of the SP params; the line
Qy.rdoParameters(0).Direction = rdParamReturnValue
return a VB errors, saying that there are no elements in the collection rdoParameters; that is it seems that the characters ? are not recognbised as parameters for the SP.
private Sub ok_Click()
'here I create my connections vars with RDO
Dim Cn as new rdoConnection
Dim Qy as new rdoQuery
Dim rs as rdoResultset
Dim str as string
'here I set my vars and establish the connection
With Cn
.Connect = "DSN=PRO; UID=" & uid.Text & " ; PWD=" & pwd.Text & ";"
.EstablishConnection rdDriverNoPrompt, false
End With
'till here no problem, the connection is established
'I set the actiove connection for my query
set Qy.ActiveConnection = Cn
'the query is a call to a Oracle8 stored procedure that has 1 param as
' input(a string) and returns an integer
str = "{? = Call claudiaa (?)}"
Qy.sql = str
'now <i should set the properties and the values of the params
Qy.rdoParameters(0).Direction = rdParamReturnValue
Qy(1) = "xyx"
set rs = Qy.OpenResultset()
rs.Close
Cn.Close
Exit Sub
End Sub
What's wrong is the settings of the SP params; the line
Qy.rdoParameters(0).Direction = rdParamReturnValue
return a VB errors, saying that there are no elements in the collection rdoParameters; that is it seems that the characters ? are not recognbised as parameters for the SP.