Saturday, January 28, 2012

Google Chrome re-sizable text area

Many websites' Contact Us page includes text area which is used to type in the message body.
In many cases these text areas are re-sizable by default if opened in Google Chrome browser.
This bug is fixable: just add this to CSS parameter of the text-area:
.my_textarea { resizenone; }

OLE DB Connection string for Excel 2007

If you want to use Excel 2007 as a data base for your application or program, the correct connection string is:

"Provider=Microsoft.ACE.OLEDB.12.0;Data Source="C:\my_location\my_file.xlsx;Extended Properties=\"Excel 8.0;HDR=YES;\";Jet OLEDB:Database Locking Mode=1";

HDR stands for header. By default the property is set to NO. If the first row of your Excel file sheet is a column name, set the property to YES.

Do not forget to set on the "Share Workbook" property in your Excel file.

Jet OLE DB Database Locking Mode

The Jet OLE DB Database Locking Mode property can be set to any of the following values:
Page-level Locking: 0 - Meaning that the entire page (or Excel sheet) will be locked when someone will edit that page or excel sheet
Row-level Locking : 1 - Meaning that only particular row which is being edited at the moment will be locked.

Obviously a better option is row-level locking.

Note 1
A database can only be open in one mode at a time. The first user to open the database determines the locking mode to be used while the database is open.

Note 2
If Excel is as database, it must be set to a shared mode. Navigate to Preview > Share Workbook and check in the  "Allow changes" check box.