Stored Procedure in Access not working (1 Viewer)

Tupacmoche

Registered User.
Local time
Yesterday, 22:23
Joined
Apr 28, 2008
Messages
291
Hi All

I'm calling a stored Procedure from Access but it is not doing anything. I have goggled it to check the syntax and it seems ok. Can anyone see what is wrong. It calls a sproc that simple truncates the table so the user can add in a new set of records. But, every time, I run it the records remain. :banghead:

Code:
Private Sub btnClear_Click()
Dim LResponse As Integer
Dim msg As String
Dim msg2 As String
Dim qdef2 As DAO.QueryDef
msg = "Under Construction"
msg2 = "Exiting... User has canceled."
LResponse = MsgBox("Are you sure you want to clear import and add new ones?", vbYesNo, "Continue")
If LResponse = vbYes Then
Set qdef2 = CurrentDb.CreateQueryDef("")
qdef2.Connect = CurrentDb.TableDefs("dbo.Import_MRN").Connect
qdef2.SQL = "EXEC sp_MRN_CleanUp"
qdef2.Execute
qdef2.ReturnsRecords = False
Set qdef2 = Nothing
Else
MsgBox (msg2)
End If
Me.MRN_Import.Requery
End Sub
 
Last edited by a moderator:

Users who are viewing this thread

Top Bottom