Error 462

Error 462

Post by John Lundb » Sat, 23 Aug 2003 11:50:36


I have a VB program that use MS Project as an object.
When I add a new record in VB Module A using the
automation method and save the record everything works.
Then without closing the VB program, I open MS Project
using ODBC to view the new data then close it.

I attempt to add another new record in Module A but my Add
function fails producing error message 462.

Here is my VB code.

General Declaration

Dim oApp As MSProject.Application
Dim oPrj As MSProject.project


Set oApp = New MSProject.Application

oApp.Visible = False

oApp.FileOpen Name:="<{SQL Server};server=" & svr
& ";database=CostScheduleDB;" & _
"userid=sa;DSN=CostSchedule>\" & Proj_Name,
ReadOnly:=False, UserID:="sa", DatabasePassWord:="",
FormatID:="MSProject.ODBC"

MSP_Status = "LOCKED"

.......
.......
.......

oApp.FileSave
oApp.FileClose pjSave
oApp.Quit pjSave
Set oApp = Nothing


The above procedure is executed each time I want to add
new record or edit existing records.

I need to be able to add more than one record in one
session of my VB program without getting error 462. I
would appreciate knowing what I am doing wrong and how to
correct the problem.

Thank you in advance
John