borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (Coverting an MS access database)Next Topic (make a variable of the tablename in an sql string) New Topic New Poll Post Reply
AndreaVB Forum : Database : Runtime Error 3061
Poster Message
gandalf12
Level: Guest


icon Runtime Error 3061

I am creating a Data Form to my database which includes  a find form, but whenever I try to use find I get a runtime error 3061 message. This tells me that I have too few parameters and that it expected 1, when I hit Debug it highlights the line datFind.Refresh. Help please

Private Sub Form_Activate()
List1.Enabled = False
datFind.DatabaseName = gDataBaseName
datFind.Refresh
If (datFind.Recordset.RecordCount > 0) Then
    Screen.MousePointer = vbHourglass
    datFind.Recordset.MoveFirst
    While Not datFind.Recordset.EOF
        List1.AddItem datFind.Recordset.Fields(0) & ""
        datFind.Recordset.MoveNext
    Wend
    List1.Enabled = True
    DoEvents
End If

lblCount = "There are " & datFind.Recordset.RecordCount & " records"
Screen.MousePointer = vbDefault
End Sub

    

23-09-2004 at 09:50 PM
| Quote Reply
Goran
Level: Moderator

Registered: 16-05-2002
Posts: 1681
icon Re: Runtime Error 3061

Check the Recordsource property of data control. you have some parameter in SQL query thay is unknown.

____________________________
If you find the answer helpful, please mark this topic as solved.

24-09-2004 at 05:17 PM
View Profile Send Email to User Show All Posts | Quote Reply
gandalf12
Level: Guest

icon Re: Runtime Error 3061

Yes, I has forgotten to put brackets around a table name with a space in it, the obvious mistakes always seem the hardest to find.

Many thanks  

26-09-2004 at 10:07 PM
| Quote Reply
AndreaVB Forum : Database : Runtime Error 3061
Previous Topic (Coverting an MS access database)Next Topic (make a variable of the tablename in an sql string) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder