Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Call MySQL SF error

2 views
Skip to first unread message

Henning

unread,
Nov 22, 2006, 8:26:34 AM11/22/06
to
Hi,

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.


Henning

unread,
Nov 22, 2006, 4:32:11 PM11/22/06
to

"Henning" <comput...@coldmail.com> skrev i meddelandet
news:45645057$0$36418$57c3...@news3.bahnhof.se...
I've tried all I can think of, StoredFunction / StoredProcedure. All is
working ok from mysql prompt.

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).


0 new messages