none
Error 3001 MS Access Query with parameter RRS feed

  • Question

  • Hi,

    We have an application with msaccess / vb /sql serveur 2000. We work in DAO.

    I've got a query with parameter using a sql view which feeds a local access table.

    I execute the query via this code :

    Function ReqParamExec(ByVal sReqNom As String, ParamArray Params())
    
      Dim rReq As QueryDef, iNoParam As Long
    
      Set rReq = CurrentDb.QueryDefs(sReqNom)
      For iNoParam = 0 To UBound(Params())
        rReq.Parameters(iNoParam) = Params(iNoParam)
      Next iNoParam
      DoCmd.SetWarnings False
      rReq.Execute dbSeeChanges
      DoCmd.SetWarnings True
    
    End Function

    Here ParamArray is one integer.

    If I launch the mdb directly or with the system.mdw using admin account, it works perfectly.
    But if I use any user account, I get the 3001 error "Invalid Argument" on

    rReq.Execute dbSeeChanges

    , whereas rReq.Parameters(0) contains my integer.

    I've ruled out :
    - office and windows installation.
    - runtime / Full access, error occures only with user account from system.mdw
    - The query works perfectly when I execute it in admin or the another user directly from the database
    - The local table that I recreated.
    - if I set the warnings at true, I've no error message about inserting the data in the table
    - with access launched in admin, the data are inserted correctly.

    All other ressources I found are no relevant and most are for ADO.

    If anyone has a clue, I'll gladly accept help.

    Thanks.

    • Moved by Martin_Xie Friday, June 18, 2010 8:06 AM Redirect to appropriate forum for better support. (From:Visual Basic IDE)
    Thursday, June 10, 2010 2:03 PM

Answers

All replies