Sunday 9 October 2016

Use OLE DB (Excel Spreadsheet) in SSRS

I have been learning a lot of SSRS and SQL server recently and have wondered how to apply the awesome toolset of SSRS to some other problems I have found.

From most of the resources I have found it is usually quoted that the only way to use excel as a datasource for SSRS is by adding the excel document as a ODBC, however in lots of environments that will not be possible due to security settings. 

In the back of my mind I was sure that I had seen excel used with OLE DB data source before. 

Finally I found an example of it working here;

Essentially you use the following connection string
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\MyExcel.xls;Extended Properties="Excel 8.0;HDR=Yes;IMEX=1";

and all works as hoped 




Success!

The only other point to make is that you need to reference the sheet name with a $ suffix,
SELECT
F1 AS rowNum
,F2 AS theValue
FROM
[Data3$]

More resources: 

I wish I found these earlier! 

Connection strings,
https://www.connectionstrings.com/excel-2007/

Stack exchange question about the same problem:
http://stackoverflow.com/questions/24499299/connecting-excel-2013-to-ssrs-2012-to-use-as-a-datasource



Monday 8 August 2016

Regenerate TS3 priv key

If you need to regenerate the ts3 priv key you can start the server with a temp admin key using

ts3server_minimal.sh serveradmin_password=YourNewPassWord
(http://shawnhyde.com/post/2010/01/12/How-to-recover-serveradmin-access-of-teamspeak3ts3-server-after-system-reload)

Login with:
login serveradmin password

Then generate key with:
use 1 tokenadd tokentype=0 tokenid1=6 tokenid2=0

(https://freevps.us/thread-11350.html)

Friday 12 February 2016

Checksums in Windows

For a while I have been meaning to find a good checksum tool that I can use within windows but have gotten around to doing it properly.

SuperUser to the rescue:
http://superuser.com/questions/166233/is-there-a-built-in-method-for-computing-an-sha-1-or-md5-hash-in-windows-7
http://superuser.com/questions/245775/is-there-a-built-in-checksum-utility-on-windows-7

These led me to this:
http://code.kliu.org/hashcheck/

There is another alternative named HashTab but after reading this and looking at each of the options I ended preferring the look of Hashcheck.