Problem with fileopen

  • Thread starter Problem with fileopen
  • Start date
P

Problem with fileopen

Hello
I have problem with fileopen command. I use OLE Automation for opening MSP
document from our application. I use MSP2003 SP3. This document is saved into

MSSQL database.
There is detailed description what we do:
1) Our application prepare data for document - write data into tables
MSP_PROJECTS, MSP_TASKS
2) Create object of class TProjectApplication
3) Make TProjectApplication.Connect
4) Make
TProjectApplication.FileOpen('<ODBCAlias>\OurApplicationData',False,0,True,'','',False,'name','password','MSProject.ODBC')

It usually works withought problems. Some problems occures only when I try
to open document which have some problem with data integrity. And these
problems

occures only when I use OLE automation. There are no problems when I open
this document directly into MSP via File-Open-ODBC.

When I use file-open-ODBC, it works correctly this way:
1) open MSP
2) File - Open - ODBC
3) create ODBC source to database with our data.
4) use this ODBC source, try to open document
5) Document have some data integrity problem. Warning message occures. For
example:
"The error ocures during import. Verify line 75, field TASK_CONSTRINT_TYPE.
Press YES for continue whith other error messages. Press NO for continue

withought error messages. Press CANCEL for ending export." - There is
probably little different text. I have localized version of MSP and message
is not in

english language.
6) I can press YES, NO or CANCEL - finally MSP open data in some way.

I can correct data - for example I change time restriction of corrupted
line. And when I save corrected file, close it and open once again, it is
corrected

and there is no problem with opening it.


Problem is when using OLE automation

when I make TProjectApplication.FileOpen, MSP opens an the same warning
message occures. But no matter if I press YES, NO or CANCEL, application
collapsed

and user lost possibility to correct data. Where is the problem? Is there
some way how configure OLE automation to work the same way how works File -
Open -

ODBC ?

Dan


P.S.:
There is another problem. It works how I described on 80% of computers. But
on some computers there are different characteristics. I use the same
application

using OLE and the same database and the same MSP2003 SP3. But in some
computers it works little different. It looks that it works correctly when I
press YES

button - application does not collapse, file open and user can repair
problem. This problem still occures when I press NO or CANCEL.
 
J

Jack Dahlgren

The two methods you are using deal with the errors differently. I don't think
that can be changed. What you can fix is the problems in the data you are
writing into the tables. You need to write valid data that won't cause
project to find errors when it is reading it.

-Jack Dahlgren
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top