CONNECTING SPICEWORKS TO EXCEL · CONNECTING SPICEWORKS TO EXCEL | 1/7/2013 Close Microsoft Query...

13
HTTP://COMMUNI CONNECT CONNECT CONNECT CONNECT ITY.SPICEWORKS.COM/PROFILE/SHOW/?TA 2013 Authored by: alexandre37 TING SPICEWOR TING SPICEWOR TING SPICEWOR TING SPICEWOR EXCEL EXCEL EXCEL EXCEL ODBC SQLITE AB=SHARED RKS TO RKS TO RKS TO RKS TO

Transcript of CONNECTING SPICEWORKS TO EXCEL · CONNECTING SPICEWORKS TO EXCEL | 1/7/2013 Close Microsoft Query...

Page 1: CONNECTING SPICEWORKS TO EXCEL · CONNECTING SPICEWORKS TO EXCEL | 1/7/2013 Close Microsoft Query or add another queries if you want to. Then go back to Excel>data>Existing Connexions.

HTTP://COMMUNITY.SPI

CONNECTING SPICEWORKS TO CONNECTING SPICEWORKS TO CONNECTING SPICEWORKS TO CONNECTING SPICEWORKS TO

HTTP://COMMUNITY.SPICEWORKS.COM/PROFILE/SHOW/?TAB=SHARED

2013

Authored by: alexandre37

CONNECTING SPICEWORKS TO CONNECTING SPICEWORKS TO CONNECTING SPICEWORKS TO CONNECTING SPICEWORKS TO EXCELEXCELEXCELEXCEL

ODBC SQLITE

SHOW/?TAB=SHARED

CONNECTING SPICEWORKS TO CONNECTING SPICEWORKS TO CONNECTING SPICEWORKS TO CONNECTING SPICEWORKS TO

Page 2: CONNECTING SPICEWORKS TO EXCEL · CONNECTING SPICEWORKS TO EXCEL | 1/7/2013 Close Microsoft Query or add another queries if you want to. Then go back to Excel>data>Existing Connexions.

1

CO

NN

EC

TIN

G S

PIC

EW

OR

KS

TO

EX

CE

L |

1/7

/20

13

SSSSuuuummarymmarymmarymmary

1 .Introduction __________________________________________________________________________ 2

2. What do we need ? _____________________________________________________________________ 2

3. Install and configure ODBC for SQLITE ____________________________________________________ 2

4. Using ODBC with Excel _________________________________________________________________ 5

5. Conclusion ___________________________________________________________________________12

Page 3: CONNECTING SPICEWORKS TO EXCEL · CONNECTING SPICEWORKS TO EXCEL | 1/7/2013 Close Microsoft Query or add another queries if you want to. Then go back to Excel>data>Existing Connexions.

2

CO

NN

EC

TIN

G S

PIC

EW

OR

KS

TO

EX

CE

L |

1/7

/20

13

1 .1 .1 .1 . IntroductionIntroductionIntroductionIntroduction

The tutorial purpose is find out how to connect the Spicework’s data base to excel. Before to begin, I would prefer warning you

about what you are about to read, because I’m French and consequently my translation might not be as good as you wish.

Hey man, why would we do that ? You are aware that thanks to the report section in Spiceworks, you can build custom made SQL requests and/or download some of them from the community report sharing page. If you want to export request results, you have a

Spiceworks functionality to do this. However, each time you want to refresh them, you have to export the request again into Excel.

ODBC allows you to execute and import directly SQL requests on the Spiceworks data base in Excel. This tool is usefull to me !

2. What do we need ?2. What do we need ?2. What do we need ?2. What do we need ?

1. Spiceworks (No way ?) 2. Excel

3. ODBC for SQLITE (http://www.ch-werner.de/sqliteodbc/)

4. Some SQL requests

3. 3. 3. 3. Install and configuInstall and configuInstall and configuInstall and configure ODBC for SQLITEre ODBC for SQLITEre ODBC for SQLITEre ODBC for SQLITE

Download ODBC from : http://www.ch-werner.de/sqliteodbc/

The direct link for the actual last release is http://www.ch-werner.de/sqliteodbc/sqliteodbc.exe.

Once installed, you may want to go now to the control panel>administrative tools>ODBC and open what we are working for.

You also can open ODBC in one shot with the run command “odbcad32” if you are lazy :D.

Page 4: CONNECTING SPICEWORKS TO EXCEL · CONNECTING SPICEWORKS TO EXCEL | 1/7/2013 Close Microsoft Query or add another queries if you want to. Then go back to Excel>data>Existing Connexions.

3

CO

NN

EC

TIN

G S

PIC

EW

OR

KS

TO

EX

CE

L |

1/7

/20

13

As you saw, my GUI is in French, I’ll try to give you the best translation but I won’t bet my life this will be good ones. What we need to do is create a system data source. You can also create a user data source but this will be effective only on the user

computer whereas the system source system will share with other allowed users the ODBC and requests. Once you have open

ODBC, look for this :

My ODBC for Spiceworks is already created but I will show you with a new one how to. Next “add..” and choose SQLite3 ODBC Driver

Page 5: CONNECTING SPICEWORKS TO EXCEL · CONNECTING SPICEWORKS TO EXCEL | 1/7/2013 Close Microsoft Query or add another queries if you want to. Then go back to Excel>data>Existing Connexions.

4

CO

NN

EC

TIN

G S

PIC

EW

OR

KS

TO

EX

CE

L |

1/7

/20

13

Fill the next windows as below :

When looking for the spicework’s data base, click browse and go to ..\spiceworks\db\spiceworks_prod.db. Maybe, you will have to change the file extention to make the .db file to appear.

Page 6: CONNECTING SPICEWORKS TO EXCEL · CONNECTING SPICEWORKS TO EXCEL | 1/7/2013 Close Microsoft Query or add another queries if you want to. Then go back to Excel>data>Existing Connexions.

5

CO

NN

EC

TIN

G S

PIC

EW

OR

KS

TO

EX

CE

L |

1/7

/20

13

Finally, this is what you get when all of this has been done :

4. 4. 4. 4. Using ODBC with ExcelUsing ODBC with ExcelUsing ODBC with ExcelUsing ODBC with Excel

I am going to show you how to create a sheet where you will add the SQL requests you want to execute. When this will be done, just save the sheet. Open it later, refresh to get the results =).

Once Excel is open, locate the “DATA” button then click on “FROM ANOTHER SOURCES”

Page 7: CONNECTING SPICEWORKS TO EXCEL · CONNECTING SPICEWORKS TO EXCEL | 1/7/2013 Close Microsoft Query or add another queries if you want to. Then go back to Excel>data>Existing Connexions.

6

CO

NN

EC

TIN

G S

PIC

EW

OR

KS

TO

EX

CE

L |

1/7

/20

13

Click on “MICROSOFT QUERY”.

If things did go straight, you must see appearing the “Spiceworks v2” data base we created earlier. You can see “Spiceworks v2” I created with you as well as “Spiceworks”, the one I actually use. Click “OK”.

Page 8: CONNECTING SPICEWORKS TO EXCEL · CONNECTING SPICEWORKS TO EXCEL | 1/7/2013 Close Microsoft Query or add another queries if you want to. Then go back to Excel>data>Existing Connexions.

7

CO

NN

EC

TIN

G S

PIC

EW

OR

KS

TO

EX

CE

L |

1/7

/20

13

Microsoft Query will open, then choose file>Execute SQL.

Copy/past the SQL Query you want to execute. You can use the queries I shared on my profile for the community if you to :

HTTP://COMMUNITY.SPICEWORKS.COM/PROFILE/SHOW/?TAB=SHARED

Page 9: CONNECTING SPICEWORKS TO EXCEL · CONNECTING SPICEWORKS TO EXCEL | 1/7/2013 Close Microsoft Query or add another queries if you want to. Then go back to Excel>data>Existing Connexions.

8

CO

NN

EC

TIN

G S

PIC

EW

OR

KS

TO

EX

CE

L |

1/7

/20

13

Now you can star at the result, pretty cool I think. But it is not over yet.

Page 10: CONNECTING SPICEWORKS TO EXCEL · CONNECTING SPICEWORKS TO EXCEL | 1/7/2013 Close Microsoft Query or add another queries if you want to. Then go back to Excel>data>Existing Connexions.

9

CO

NN

EC

TIN

G S

PIC

EW

OR

KS

TO

EX

CE

L |

1/7

/20

13

I guess nobody wish to copy/paste each time the request to get the result, so I suggest you to save it. File>save as…

Page 11: CONNECTING SPICEWORKS TO EXCEL · CONNECTING SPICEWORKS TO EXCEL | 1/7/2013 Close Microsoft Query or add another queries if you want to. Then go back to Excel>data>Existing Connexions.

10

CO

NN

EC

TIN

G S

PIC

EW

OR

KS

TO

EX

CE

L |

1/7

/20

13

Close Microsoft Query or add another queries if you want to. Then go back to Excel>data>Existing Connexions. If things did go straight, you must see queries you saved earlier. MY_REQUEST is selectable, so select it.

Page 12: CONNECTING SPICEWORKS TO EXCEL · CONNECTING SPICEWORKS TO EXCEL | 1/7/2013 Close Microsoft Query or add another queries if you want to. Then go back to Excel>data>Existing Connexions.

11

CO

NN

EC

TIN

G S

PIC

EW

OR

KS

TO

EX

CE

L |

1/7

/20

13

When selected, Excel will ask you as below where you want to import data, so obviously you may want to use the first cell of the sheet. Then click OK.

Here is the result :

Page 13: CONNECTING SPICEWORKS TO EXCEL · CONNECTING SPICEWORKS TO EXCEL | 1/7/2013 Close Microsoft Query or add another queries if you want to. Then go back to Excel>data>Existing Connexions.

12

CO

NN

EC

TIN

G S

PIC

EW

OR

KS

TO

EX

CE

L |

1/7

/20

13

5. 5. 5. 5. ConclusionConclusionConclusionConclusion

As a conclusion, just save your sheet or open a new sheet in your workbook to import more queries. From now on, just open your sheet, click on refresh and do what you have to with data. For MacroMen, VBA users… I think you might find this a bit usefull.