Connecting to your SQL database using Excel - how to!

E
Emma Seaton 👤 Member for 20 years 8 months
S
Samir N 👤 Member for 13 years 2 months

Hello Everyone,

am trying to connect my oracle database from excel and it seems am doing something wrong, Data -> External Data -> From SQL Server

excel is asking about Server name and login information

by default my server name is PMDB on my computer so i use localhost\PMDB with pubuser (or privuser) as login information and its not working...

 

what am doing wrong ?! 

S
Sarah Benjamin 👤 Member for 18 years 1 month

You can install the SDK by choosing Custom on the installation choices, then checking off the box next to SDK. There is some configuration required to make sure the database connects but it’s not too difficult.

A
Arend Kok 👤 Member for 18 years

Hi,



Everyone here keeps talking about a SDK. I know there is a API available, but I did not now about a SDK.



Could you please tell me where to get hold of this SDK?



Thanks!

S
Sarah Benjamin 👤 Member for 18 years 1 month

I have successfully connected via SDK to my data, with my end goal being graphical reports. I can use any of the following: Excel, Access, or Crystal Reports. I don’t have much experience with Access or Crystal, but I have been told these are the best tools for the job. I need help navigating the data to be able to set the report to look at the right information.



I want to make a single project report that summarizes all open issues, risks, milestones, and some user-defined-fields (indicators). It’s basically a project dashboard. I want to create the report so that I can fit all this on one sheet of paper. If anybody can help, I need assistance with setting up my queries!



Thanks,

Sarah

H
Hannes de Bruyne 👤 Member for 20 years 10 months

Hi Mark



can you please tell me the name of the files and the path were to find them?



"

The lookup tables for the database mapping is in the >Documentation folder on installation disk 1, and there’s >also a schema telling you what links to what.

"



It is also quit interesting to connect using ACCESS, but for that its good to know what links to what.

M
Mark Chapman 👤 Member for 20 years

The first page has the handy tip.



I tried this but I don’t find the tables I am looking for such as PROJECT, TASK, PROJCATVAL, etc..I do see 20+ other tables. Why no PROJECT table?





>The lookup tables for the database mapping is in the >Documentation folder on installation disk 1, and there’s >also a schema telling you what links to what. The most >useful tables I found so far are PROJECT, TASK >>(activities), PROJCATVAL (project code values), but there >are many many more... have a look around and enjoy!!

E
Emma Seaton 👤 Member for 20 years 8 months

Thanks for the info, Kevin. I shall give it a go.



I’ve tried using access, but as my knowledge on it isn’t as good as excel I didn’t get very far! I managed to get the data tables, but then got stuck on what to do with it!!



;o)



SDK sounds so much easier if it works!... hum, back to good old excel!



Cheers



Emma

K
Kevin Button 👤 Member for 22 years 10 months

Emma



Accessing a networked database is the same as local, just change the SDK driver (ODBC configuration) to look at the new server and database.



Updating Primavera data via excel requires you to write some VBA code, first to change the Scope and Access levels in the Project table, then to do the updates you want in other tables. I find MS Access is so much easier, because I can do the Scope and Access queries quickly and then depending on what changes I have to make, can create more queries to change data or paste stuff into Primavera tables from Excel or elsewhere.



Personally I find extracting data via SDK is much easier using MS Access than Excel and I use Excel for pasting stuff from Primavera to do graphs etc.



Cheers

E
Emma Seaton 👤 Member for 20 years 8 months

Also I found that the connection to the database via Excel was one way only - from the dbas to Excel, so data integrity was maintained. I didn’t really investigate going the other way except by using SDK. The other reason for using SDK was to download the Notebook fields which Primavera told me was the only way to do it - otherwise I got a load of junk across!



I always got the response in Excel of ’missing string’ when trying to get to SDK.



I gave up in the end, and can’t even use it now I’m off standalone (unless anyone knows how to access a networked P5 (not experimented yet!).



Emma

K
Kevin Button 👤 Member for 22 years 10 months

Just remember that updating data by using a direct database connection instead of via the SDK is not a great idea. The SDK will enforce business rules that are built into the software so you can’t insert dodgy data like you can with a direct connection.



Extracting data is also better with SDK because there is so much more available. The logical database schema provided by the SDK offers much more data fields that the physical schema, and it also has extended tables which makes it much easier to do multiple table queries.

M
mimoune djouallah 👤 Member for 19 years 8 months

hi andrew



we are speaking here in the case the user want to update the data using front end software excel acess etc



anyway for my case it gives me this error





database key word not present in connect string



please need help



friendly



hi Alex where are you ? i though u are our IT superhero

A
Andrew Podolny 👤 Member for 21 years 6 months

Hi guys.

Connection to PMDB from Excel or any other application (Access, Crystal Report...) doesn’t require SDK installed.

All you have to do - is to create connection to your SQL / Oracle server. It works for me (Windows XP SP2, MSDE -2000, PM 5). The connection string to activities table looks like this:



Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=True;Initial Catalog=PMDB;Data Source=your_SQL_name\primavera;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=your_Workstation_ID;Use Encryption for Data=False;Tag with column collation when possible=False



Command type: TABLE



Command text is following:

"PMDB"."privuser"."TASK"



Hope this will be helpful



Best regards,

Andrew

M
mimoune djouallah 👤 Member for 19 years 8 months

thanks kevin



but it seems i have the same problem now as post N° 17



i installed all the stuff; alias and so one; but it don’t want to connect although i get the login screen but afterward it gives an error.



anyway it is like a revolution in comparing to P3.



thanks




K
Kevin Button 👤 Member for 22 years 10 months

Mimoune



You can install the SDK from the same CD that you installed P5. Check the adminguide.pdf file for instructions.



Good luck

M
mimoune djouallah 👤 Member for 19 years 8 months

hi Mario, Kevins



ok thanks, as it did not worked for me; i thought it is a story of a licence.



i think it is a time to learn some sql language.



thanks

M
mimoune djouallah 👤 Member for 19 years 8 months

hello Kevins



when i go to admin users and try to check to Integration API it says total named users exceed licenced maximum users and for concurrent users i can’t even check to box.



i have only 1 licence to pm and 1 portofolio analysis





friendly.

K
Kevin Button 👤 Member for 22 years 10 months

Mimoun



Unless Primavera have changed their licencing you shouldn’t need a separate licence for SDK, I have always just installed it and started using it. The Java API requires a separate licence.

M
mimoune djouallah 👤 Member for 19 years 8 months

hi emma



thanks for your tutorial :) it just works, unfortunately my licence don’t allow me to use sdk delivred with P5 otherwise it would be great to update data from excell.



emma as i am not expert in sql language key, table etc... can you please send me a sample file all i need is the sql query



my email is [email protected]



thanks in advance



friendly yours

E
Emma Seaton 👤 Member for 20 years 8 months

Anyone have success in connecting to SDK via Excel - mine just doesn’t want to play. I’ve tried reinstalling SDK, but I think the problem might be with excel not SDK. Any hints gratefully received!



Emma

S
Sanjiv Parekh 👤 Member for 24 years 8 months

Very useful.... b cos many people still love excel to play around for reports....

K
Kevin Button 👤 Member for 22 years 10 months

The SDK documentation lists all database tables and fields, as well as the Project Manager field names. When you install the SDK the documentation is also installed. Check the file "C:\Program Files\Common Files\Primavera Common\PMSDK\Doc\index.html"



Cheers



Kevin

B
Brian Cameron 👤 Member for 22 years 1 month

Hi Emma



Just to let you know there is another way to get to the information you are looking for (and possibly a lot more I don’t know about).



I have been experimenting with the a similar thing as you but I’ve been using Crystal Reports to connect directly to the SDK information.

The reason for this is I can produce presentable information and I can run filters within Crystal so as I can have groups, individuals, task or anything that I have data for presented just the way I want and I don’t corrupt the database information, all I have to do is hit refresh and the data is updated.

I get connected OK through Crystal to SDK but then I have to sift through the information that is there.

I found a few useful fields mostly the "X-****" information is the better data sources to look through. I have contacted Primavera but they don’t have a reference dictionary/directory that can be used to cross reference the names and information that is represented in project manager, the printout of the schema is huge and I suspect I need a bit of information from a variety of fields.



Primavera response to my query

There is nothing available like the document you have requested. I would

suggest making use of the schema as given in prim26236. These are in

HTML format and contains all tables with a brief description of each

table and each field in those tables.



Please also refer to the SDK documentation for further details including

a programmers guide. Details of this from prim28371 can be found below:



I will have to get back to trying this again when I get a chance.



Regards



Brian.


E
Emma Seaton 👤 Member for 20 years 8 months

I’m still investigating the two way data transfer with excel, but give the Primavera SDK (Software Development Kit) a try. There’s instructions on Knowledge Base on how to install it. I’ve got it running, but excel is proving to be awkward and comes up with a ’General Error - Database Keyword not present in the connect string’ error when setting up the SDK as a new data source.. If anyone knows what this means and how to work around it I’d love to know.



Emma

A
Amir Dadbakhsh 👤 Member for 21 years 8 months

Dear Emma

Thanks for sharing your valuable experience.

I’ve used other interface to connect to primavera enterprise database but it is always my wish to connect by Excel.

I knew those mentioned steps but my problem is:

I make a excel query and bring data in excel sheet, I want that when I make a change in paste data in excel, the same data will be changed in primavera but it is not happened.

When I push "refresh all", excel file synchronizes itself by primavera (data transfer from primavera to excel not from excel to primavera).

I’ll be glad to hear your solution to how solve this problem.

Kind Regards

Amir Dadbakhsh

E
Emma Seaton 👤 Member for 20 years 8 months

The problem with all of these methods of copying from P3e to excel is that the data is out of date as soon as any changes are made - which with in excess of 40 programmes is happening all the time. Whereas using a direct connection into the database using the SQL query interface the data can be, and in this case is, set to refresh as soon as the excel file is opened, and can be refreshed at any time by clicking the refresh button on the ’external data’ toolbar. I can treat this data as live, rather than as merely a copy of the live data and can be confident that it matches P3e at any time).



Hope that makes sense!!



Emma

J
Jonathan Johnson 👤 Member for 20 years 1 month

If you wanted to get info out of Excel and you have Primavera Project Management 5.0 you can just export to a an excel file. And if you want to import from Excel to PM5.0 you just have to export from PM5.0 to get the right column header mappings then fill in the info and import back in.

E
Emma Seaton 👤 Member for 20 years 8 months

Hi Steve, hope you’re well...



I briefly looked at Pivot Tables but they seemed to be all about summarizing data - ie. how many times a value occurs in a table. Is there another way of using them that I’ve not worked out? (I suspect there is!!)

E
Emma Seaton 👤 Member for 20 years 8 months

Um, those columns don’t look much like columns, but hopefully you get the idea!!

E
Emma Seaton 👤 Member for 20 years 8 months

No, all I’m doing is creating a tabular report with projects down the left hand side and key activities across the top with dates in the cells below. This would look thus:



Project.....Remit.....Design...Authority...Site...etc

P01 Bridge..12/12/06..31/3/07..20/4/07.....1/6/07...

P02 Station.2/3/06....5/6/06...20/7/06.....15/9/07...



and so on in a list down the page (ignore the dots, just keeps the words in columns here).



I just couldn’t get the data the right way round in P3e, but it works perfectly in excel once I got the interface sorted out (aren’t Help pages great!!!).



Emma

E
Emma Seaton 👤 Member for 20 years 8 months

Thanks Brad, I’ll send you a copy via email of the results of my SQL queries.



Emma


Forum Sponsor

Top Posters

EViLL1
1 posts
Dimitrios Theocharidis
3 posts
MichaelFuelsC
0 posts
anwar zeb
1 posts
olva seselima
1 posts
Muhammd Muneer
0 posts
sairam
0 posts
MARAT BILYALOV
0 posts
RichTea66
0 posts
Muneer Muhammad
1 posts