QueryDefs

  • I have the following code which calls from querydef my store procedure in the SQL server which deletes records in the table, the code runs fine,but not doing anything, what I am missing? Thank you

    Dim qdf As DAO.QueryDef

    Dim strConnect As String

    Dim ConnectStr As Variant

    'Delete records from tblCust

    Set qdf = CurrentDb.QueryDefs("qryDeletetblCust")

    If IsMissing(ConnectStr) Then

    strConnect = qdf.Connect

    Else

    strConnect = CStr(ConnectStr)

    End If

    qdf.SQL = sqlstatment

  • I haven't done access programming in years, but just looking at it, I don't see where you have given a command to actually execute the stored proc. Can you check for possible other commands once you have set the definition?

    Lee

    http://www.texastoo.com

  • it is exuciting inside of the querydef

  • So try a qdf.Execute and see if it gives you option. qdf won't run by itself I don't believe.

    Lee

    http://www.texastoo.com

  • Thank you it worked

  • np

    Take care

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply