Anyone know why I get 'Object Collection: Couldn't find item indicated by
text.'
Sub GetOrder(nr As String)
'DAO declares
Dim wrkODBC As Workspace
Dim conn As Connection
Dim rs As Recordset
Dim strSQL As String
Dim tmp As Integer
Dim i As Integer
'RDO declares
Dim cn As New rdoConnection
Dim MyRetValue As Integer
Dim rdors As rdoResultset
Dim Ps As New rdoQuery
With cn
.Connect = "dsn=MyODBC3;uid=" & SetUp.Dator &
";pwd=bydalen;database=skidata"
.EstablishConnection Prompt:=rdDriverNoPrompt
End With
'findshoe is a StoredFunction, RETURNS TINYINT
strSQL = "{? = call getshoe(?) }"
Set Ps = Nothing
Set Ps = cn.CreateQuery("getshoes", strSQL)
Ps(0).Type = rdTypeTINYINT
Ps(0).Direction = rdParamReturnValue
'Ps(1).Direction = rdParamInput
Select Case Len(nr)
Case Is < 4
tmp = Val(nr)
strSQL = "SELECT * FROM skodata WHERE kundid = " & tmp & ";"
Case 4
tmp = Val(nr)
Ps.rdoParameters(1) = tmp '**** THIS LINE THROWS ERROR****
Case 10
strSQL = "SELECT * FROM skodata WHERE persnr = " & nr & ";"
End Select
From MySQL:
CREATE FUNCTION `getshoe`(param1 TINYINT) RETURNS TINYINT
The StoredFunction works from MySQL command line.
/Henning
--
Time is present only to prevent everything from happening at once.
Still it seems that everything happens at once.
Then there must be a bug in time.
To find the bug in time, isn't that what we all hope for.
When I change to SP with one INOUT parameter:
strSQL = "{call findshoe (?)}"
Ps(0).Direction = rdParamInputOutput
Ps.rdoParameters(0).Value = tmp
Set rdors = Ps.OpenResultset(rdOpenDynamic) *** Error OUT or INOUT argument
1 is not a variable ***
Any ideas?
/Henning
I have changed MyODBC (3.51.09 does not support SP's), 3.51.14, (5.0.3 in
beta and is not working).