Run-Time Error 3061


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Run-Time Error 3061

Hybrid View

  1. #1
    Steve Kocon Guest

    Run-Time Error 3061


    Can anyone teel me why the following code generates the run-time error 3061.
    "Too few parameters. Expected one."

    This error is generated every time I try to execute the query in VB6.

    No other errors are generated.



    Private Sub cmdSelectCAR_Click()
    Dim dbsCA2000 As Database
    Dim strSQLSelectCAR As String
    Dim qdfSelectCAR As QueryDef
    Dim strParam As String

    strParm = "PARAMETERS [Enter CAR Number] TEXT; "




    strSQLSelectCAR = "INSERT INTO Temp ( [CAR Number], Assignee, [Date Issued],
    [Date Due], [Date Closed], [Reject Tag Number], Customer, [Part Number],
    [Shop Order Number], [Quantity Rejected], [CAR Received], [CA Approved By],
    [Effective Date], [Follow-Up Req'd], Nonconformity, [Root Cause], [Corrective
    Action], [Follow-Up Action], Notes )" _
    & "SELECT [Corrective Action Request].[CAR
    Number], [Corrective Action Request].Assignee, [Corrective Action Request].[Date
    Issued], [Corrective Action Request].[Date Due], [Corrective Action Request].[Date
    Closed], [Corrective Action Request].[Reject Tag Number], [Corrective Action
    Request].Customer, [Corrective Action Request].[Part Number], [Corrective
    Action Request].[Shop Order Number], [Corrective Action Request].[Quantity
    Rejected], [Corrective Action Request].[CAR Received], [Corrective Action
    Request].[CA Approved By], [Corrective Action Request].[Effective Date],
    [Corrective Action Request].[Follow-Up Req'd], [Corrective Action Request].Nonconformity,
    [Corrective Action Request].[Root Cause], [Corrective Action Request].[Corrective
    Action], [Corrective Action Request].[Follow-Up Action], [Corrective Action
    Request].[Notes]" _
    & "From [Corrective Action Request]" _
    & "WHERE ((([Corrective Action Request].[CAR Number])=[Enter CAR Number]));"




    Set dbsCA2000 = OpenDatabase("c:\vb samples\ca2000\CA2000.mdb")

    Set qdfDeleteTemp = dbsCA2000.CreateQueryDef("", strSQLSelectCAR)

    dbsCA2000.Execute strSQLSelectCAR
    End Sub

    Thank you in advance.

    Steven A. Kocon


  2. #2
    __Jester Guest

    Re: Run-Time Error 3061


    My guess would be you have a Typo somewhere. Make sure all your fields are
    inserted into and spelled correctly





    "Steve Kocon" <stkocon@usfamily.net> wrote:
    >
    >Can anyone teel me why the following code generates the run-time error 3061.
    > "Too few parameters. Expected one."
    >
    >This error is generated every time I try to execute the query in VB6.
    >
    >No other errors are generated.
    >
    >
    >
    >Private Sub cmdSelectCAR_Click()
    > Dim dbsCA2000 As Database
    > Dim strSQLSelectCAR As String
    > Dim qdfSelectCAR As QueryDef
    > Dim strParam As String
    >
    > strParm = "PARAMETERS [Enter CAR Number] TEXT; "
    >
    >
    >
    >
    > strSQLSelectCAR = "INSERT INTO Temp ( [CAR Number], Assignee, [Date Issued],
    >[Date Due], [Date Closed], [Reject Tag Number], Customer, [Part Number],
    >[Shop Order Number], [Quantity Rejected], [CAR Received], [CA Approved By],
    >[Effective Date], [Follow-Up Req'd], Nonconformity, [Root Cause], [Corrective
    >Action], [Follow-Up Action], Notes )" _
    > & "SELECT [Corrective Action Request].[CAR
    >Number], [Corrective Action Request].Assignee, [Corrective Action Request].[Date
    >Issued], [Corrective Action Request].[Date Due], [Corrective Action Request].[Date
    >Closed], [Corrective Action Request].[Reject Tag Number], [Corrective Action
    >Request].Customer, [Corrective Action Request].[Part Number], [Corrective
    >Action Request].[Shop Order Number], [Corrective Action Request].[Quantity
    >Rejected], [Corrective Action Request].[CAR Received], [Corrective Action
    >Request].[CA Approved By], [Corrective Action Request].[Effective Date],
    >[Corrective Action Request].[Follow-Up Req'd], [Corrective Action Request].Nonconformity,
    >[Corrective Action Request].[Root Cause], [Corrective Action Request].[Corrective
    >Action], [Corrective Action Request].[Follow-Up Action], [Corrective Action
    >Request].[Notes]" _
    >& "From [Corrective Action Request]" _
    >& "WHERE ((([Corrective Action Request].[CAR Number])=[Enter CAR Number]));"
    >
    >
    >
    >
    > Set dbsCA2000 = OpenDatabase("c:\vb samples\ca2000\CA2000.mdb")
    >
    > Set qdfDeleteTemp = dbsCA2000.CreateQueryDef("", strSQLSelectCAR)
    >
    > dbsCA2000.Execute strSQLSelectCAR
    >End Sub
    >
    >Thank you in advance.
    >
    >Steven A. Kocon
    >



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center