Can't find the object in Visual Basic

Georgina

Registered User.
Local time
Today, 16:47
Joined
Jan 25, 2001
Messages
19
Hi

I have an adp with SQL 2000 backend. I am trying to execute a stored procedure via Visual Basic using:

Private Sub Command1_Click()
On Error GoTo Err_Command1_Click
Dim stDocName As String
DoCmd.SetWarnings (False)
DoCmd.OpenStoredProcedure "Append"
DoCmd.SetWarnings (True)
Exit_Command1_Click:
Exit Sub

Err_Command1_Click:
MsgBox Err.Description
Resume Exit_Command1_Click

End Sub

The problem that I have is that I get an error message saying:

Microsoft Access can't find the object 'Append.'

Its sat quite happily in my database and I can execute it manually if I want to.

The stored procedure actually works though:

Alter PROCEDURE [dbo].Append AS
set nocount on
INSERT INTO [Training History] ( EmployeeID, TrainingDate, TrainingProvider, TrainingType, TrainingNotes )
SELECT [Employee Data].EmployeeID, [Employee Data].TempTrainingDate, [Employee Data].TempTrainingProvider, [Employee Data].TempTrainingType, [Employee Data].TempTrainingNotes
FROM [Employee Data]
where employeeid is not null and TempTrainingDate is not null

The data that I want to insert goes into the table OK

Any help much appreciated!

Thanks

George
 

Users who are viewing this thread

Back
Top Bottom