Wednesday 26 October 2011

Saturday 22 October 2011

How to disable the keyboard 'sleep' button on a windows PC

If you happen to own a keyboard with a sleep button in a terribly inconvenient location, such as next to a built-in keyboard volume control or next to your 'esc' key, occasionally causing you to accidentally put your PC to sleep, then there's hope. 


1). Go into power options in Windows Control Panel, (Start>Control Panel>Power Options)

 2). There should be an option on the left side menu to "Choose what the power buttons do". Clicking on that option will take you into System Settings, where you can 'define power buttons and turn on password protection'.


 3). Under "Power and sleep button settings", you can change the selected option for "When I press the sleep button:" in the drop down from 'Sleep' to 'Do nothing'


 4). Click 'Save changes', and Bob's your uncle! no restart necessary.


Wednesday 19 October 2011

Help with debugging JavaScript and/or identifying performance issues in IE

One of the improvements in IE 8 was the introduction of a JScript profiler which can provide useful JScript-related performance data during web development, and this feature has also been carried over into IE9.

To access the profiler, from IE9, launch the developer tools window either by selecting 'Tools>F12 developer tools' from the menu (shortcut keys: ALT+T,  L) or toggle on/off simply by pressing F12.

From the developer tools window, switch to the 'Profiler' tab, and then click 'Start profiling' to begin a profiling session. Click 'Stop profiling' to end the session. You can then view the resulting performance report in either 'Functions' view or 'Call tree' view, using the 'Current View' dropdown at the top of the window.

The developer window has a number of other handy features as well, such as disabling the pop-up blocker, disabling CSS, or validating HTML & CSS, etc.

More information can be found on the MSDN blog at: http://blogs.msdn.com/b/ie/archive/2008/09/11/introducing-the-ie8-developer-tools-jscript-profiler.aspx

Monday 10 October 2011

To configure Gmail on an Apple device (e.g. iPhone, iPad, iPod Touch), using Safari browser:

1. Make sure you've enabled 'IMAP' in your Gmail settings
2. Open the Settings app on your device
3. Tap Mail, Contacts, Calenders
4. Tap Add Account
5. Tap Gmail
6. Enter you account information, being sure to use your full Gmail address, uncluding @gmail.com
7. Tap Next
8. Tap Save

See full instructions on the Goggle Mail Help website, at : https://mail.google.com/support/bin/answer.py?answer=77702

Friday 7 October 2011

OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "Linked_Server_Name" returned message "Could not find installable ISAM.". Msg 7303, Level 16, State 1, Line 1 Cannot initialize the data source object of OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "Linked_Server_Name".

The knowledgebase at support.microsoft.com indicates this error can be the result of missing files or wrong filepaths in the Windows registry, etc. Check out suggested fixes here: http://support.microsoft.com/kb/283881/en-gb

However, I have also experienced that you will also get this error if your @provstr= for the Linked_Server_Name is set to "Excel 97 workbook" instead of "Excel 8.0"

For Example:

EXEC master.dbo.sp_addlinkedserver @server = N'Your_Linked_Server_Name', @srvproduct=N'Excel', @provider=N'Microsoft.Jet.OLEDB.4.0', @datasrc=N'C:\MortgagesDatabase\MortgageProduct.xls', @provstr=N'Excel 97 workbook'

instead of:

EXEC master.dbo.sp_addlinkedserver @server = N'Your_Linked_Server_Name', @srvproduct=N'Excel', @provider=N'Microsoft.Jet.OLEDB.4.0', @datasrc=N'C:\MortgagesDatabase\MortgageProduct.xls', @provstr=N'Excel 8.0'

Rounding decimal or floating point numbers in C#

Example from stackoverflow: http://stackoverflow.com/questions/257005/how-do-you-round-a-number-to-two-decimal-places-in-c


decimal a = 1.994444M;

Math.Round(a, 2); //returns 1.99

decimal b = 1.995555M;

Math.Round(b, 2); //returns 2.00


Math.Round also has an overload for rounding-to-even:

Math.Round(a, 2, MidPointRounding.ToEven);

Tuesday 4 October 2011

The OLE DB provider "Microsoft.Jet.OLEDB.4.0" has not been registered.

Depending on your OS you could run odbcad32.exe on your SQL Server to bring up the Data Sources screen where you should be able to confirm what ODBC providers the server has installed (or not installed), as the case may be.


If you're using 64bit, then this error most likely results from the fact 64-bit SQL Server cannot use Jet, as there is no 64-bit OLEDB provider for Jet.


I came across a possible word-around, which could be to execute the following script in MSSMS, and then restart the MSSQLSERVER service:

EXEC

sp_configure 'show advanced options', 1;
GO

RECONFIGURE

;
GO

EXEC

sp_configure 'Ad Hoc Distributed Queries', 1
GO

RECONFIGURE

;
GO
Additional help can be found on this .Net forum: http://www.sqlservercentral.com/forums/Topic445277-149-1.aspx

Error 7399 When You Run a Linked Server Query That Uses the OLE DB Provider for Microsoft Jet


You may get the following errors when you run a query on a Linked Server that is configured to use OLEDB 4.0 provider for Microsoft Jet:

Error 7399: OLE DB provider 'Microsoft.Jet.OLEDB.4.0' reported an error.
[OLE/DB provider returned message: Unspecified error]
OLE DB error trace [OLE/DB Provider 'Microsoft.Jet.OLEDB.4.0' IDBInitialize::Initialize returned 0x80004005: ].
OR
"Error 7399: OLE DB provider 'MSDASQL' reported an error. Driver's SQLSetConnectAttr failed The Microsoft jet database engine cannot open the file '(unknown)'. It is already opened exclusively by another user, or you need permission to view its data."


These problems probably occur because the login account does not have access to the temporary folder of the SQL Server startup account, because the linked server query runs in the context of the login account. If you run a linked server query, SQL Server tries to create a temporary file data source name (DSN) in the temporary folder of the SQL Server startup account.

To work around this problem, you could try the following:

1. Log on to the computer by using the SQL Server start up account.
2. Create a folder named Temp in the operating system installation directory.
3. Permit full access to a non-administrator account on the Temp folder.
4. Set the value of the TEMP and TMP user variables of the SQL Server startup account to the newly created Temp folder. To do so, follow these steps:
a. Right-click My Computer, and then click Properties.
b. Click the Advanced tab, and then click Environmental Variables.
c. In the User variables for Logon User list, click TEMP, and then click Edit.
d. In theVariable Value box, type C:\Temp as the location of the new Temp folder, and then click OK.
e. Repeat steps c and d to set the value of the TMP variable.
f. Click OK two times.

5. Log off, and then log on to the computer by using SQL Server startup account.
6. Restart the SQL Server services.


However, I've also experienced that you may get these errors if the datasource (i.e. the file path supplied in the @datasrc parameter of the sp_addlinkedserver query command) does not exist, or is missing. For example, if you forget to copy the file into the folder where the data source parameter of your linked server points to.


http://support.microsoft.com/kb/814398