|
|
|
date: Fri, 19 Sep 2008 16:55:55 +0530,
group: microsoft.public.project
back
Re: Microsoft.Project.OLEDB.11.0 Exception
Hi,
This is why VB is so much quicker to debug! In VB I would get this code
working in Excel VBA then copy to VB and it would pretty much work.
Have you fully defined the file path (as in "C:|Projects\MyProject.mpp")?
Note the 2003 oledb driver can't read Project 2007 format files and 2007
does not support oledb.
--
Rod Gill
Microsoft MVP for Project
Author of the only book on Project VBA, see:
http://www.projectvbabook.com
"ansu" wrote in message
news:ansu.3fzhzc@DoNotSpam.com...
>
> Hi All,
>
> Iam getting the following error while reading MSProject file,
>
> "Provider cannot be found,It may not be properly installed." when i try
> to do
>
> private bool IsProjcectOledDBSupported(string filename) {
> ADODB.ConnectionClass conn = new ADODB.ConnectionClass();
>
> try
> {
>
> conn.Disconnect += new
> ADODB.ConnectionEvents_DisconnectEventHandler(conn_Disconnect);
> conn.CommandTimeout = 30;
> conn.Open("Provider=Microsoft.Project.OLEDB.11.0;PROJECT
> NAME=" + filename, null, null, 0); ---Getting Error at this line
> conn.Close();
> conn.Cancel();
> conn = null;
>
> }
> catch (Exception ex)
> {
> conn = null;
> return false;
> }
> return true;
>
> }
>
> Note : I have MSProject 2003 Installed on my system.
>
> Need Help,
> Regards.
>
>
> --
> ansu
> ------------------------------------------------------------------------
> ansu's Profile: http://forums.techarena.in/members/ansu.htm
> View this thread: http://forums.techarena.in/microsoft-project/1040835.htm
>
> http://forums.techarena.in
>
date: Sat, 20 Sep 2008 07:23:01 +1200
author: Rod Gill rodATproject-systemsDOTcoDOTnz
Re: Microsoft.Project.OLEDB.11.0 Exception
Hi Rod,
Thank you very much for quick response,yes i know that oledb driver
can't read Project 2007 format files ,iam trying to read 2003 MS Project
File only and file name is also proper. :(
Rod,I have a Question away from current topic,i hope you don't mind and
guide me in a right way.
Some days back i Automated Import/Export of Ms Project in my
application,evrything is working fine,but only concern is time.It is
taking a lot of time to import/Export,
this is what iam doing for Import.
/*
Sample Code
foreach (MSProject.Task task in this.msProj.Tasks)
{
if (task.Notes == string.Empty)
rowArray.Add("No Notes");
else
rowArray.Add(task.Notes);
rowArray.Add(Convert.ToInt32(task.GetField(MSProject.PjField.pjTaskOutlineLevel)));//levelId
rowArray.Add(Convert.ToDouble(task.Duration) /
480);
rowArray.Add(Convert.ToDateTime(task.Start));
rowArray.Add(Convert.ToDateTime(task.Finish));
// Add rowArray to my DataTable and then saving it to backend,this
whole process is taking a lot of time.
}
*/
For Export
/*
// Reading each row from datatable and adding it to task
//msProj is MSProject.Project object
this.msProj.Tasks.Add(dRow["TaskName"].ToString(),
System.Reflection.Missing.Value);
this.msProj.Tasks[this.msProj.Tasks.Count].SetField(MSProject.PjField.pjTaskOutlineLevel,
outLineLevel.ToString());
task.Duration = dRow["Duration"];
if (dRow["Duration"].ToString() == "0")
{
task.Start = plndStart;
task.Finish = plndEnd;
}
// This export is taking too much of time
*/
can u please tell me how can i improve the performance while
import/export
--
ansu
------------------------------------------------------------------------
ansu's Profile: http://forums.techarena.in/members/ansu.htm
View this thread: http://forums.techarena.in/microsoft-project/1040835.htm
http://forums.techarena.in
date: Mon, 22 Sep 2008 16:42:31 +0530
author: ansu
|
|