VB 3 Question: Can't set formal parameter

VB 3 Question: Can't set formal parameter

Post by Rob Yos » Sat, 12 Feb 2000 04:00:00

I am creating a dynaset as follows:

set ds = db.createdynaset("some sql")

The problem is in a multiuser environment, every once in a while the table I
am using in the query is being updated.  I handle this in other parts of my
program by calling a function that does retrys:

i.e  instead of calling:
I would call

genDsUpdate ds

Sub genDsUpdate (ds As Dynaset)
    Dim Retry As Integer

    Retry = 0
    On Error GoTo dsUpdateTryAgain
    On Error GoTo 0
    Exit Sub
    If (Retry < 1000) Then
        Wait 10
        Retry = Retry + 1
        MsgBox "Error: " & Err & "-" & Error & " Occured While Trying To
Update This Record. Possibly This Record Is Locked By Another Workstation."
        Exit Sub
    End If
End Sub

I would like to do the same thing for createdynaset, but I can't make a
function that returns a dynaset, and I can't pass the dynaset because when I
try set it in a function it says "Can't Set formal parameter".

So, sorry its so long, the question is how do I create a function that does
the createdynaset?

Thanks in advance,

PS - summarized:

Function genCreateDS (s as String) as Dyanset
    static ds as Dyanset
    set ds = db.createDynaset(s)

Give the error Expected Integer, Long, String or Variant

Sub genCreateDS (ds as Dyanset, s as String)
    set ds = db.createdynaset(s)

Gives error "Can't set formal parameter"


1. Passing Parameters to stored parameter queries using VB 5's Data Controls


I have a Data control in a VB5 program to manage the main table (Businesses)
and then i'd like to use a data control with a subquery to show all the
contacts for that business. The way im doing it right now is changing the
.recordsource property of the subquery data control every time the main data
control is repositioned.

Is there a way to use stored parameter queries in an Access database,
instead of having to type the SQL in the .recordsource property?

Thank you in advance,

    Nuno Ferreira

2. Advice for 070-219

3. Formal parameter '@v_type' was defined as OUTPUT but the actual parameter not declared OUTPUT.

4. Ingres stack dump

5. Error: Formal Parameter was defined as output ...

6. ACCESS2k -> postgres via ODBC

7. TStoredProc and Boolean Formal Parameters

8. My Users Are Not Happy about DCOM98

9. Passing PL/SQL tables in formal parameter list

10. if you will promise Allahdad's swamp against cans, it will angrily depart the unit

11. Using VB 4.0 with DBF's, CDX's and Setting a Filter

12. 'Parameters' question

13. Can't set parameter to default SQL 7