The USB Pen Drive (16GB no-brand – cheap buy) got stuck on Read Only and I couldn’t format it. The error “Disk is write protected” kept appearing when trying to format the Usb drive in “Computer” on Windows 7.
I tried pretty much everything out there and was nearly ready to pack it in. Most websites (especially the sandisk forums) just said to return the USB Drive and get a refund – that this was a known issue and that if/when the USB Drive encounters an error, it puts the USB Drive into Read Only to allow for disaster recovery. It was possible to read and see the files on the USB Drive, but it wasn’t possible to delete or format the USB Key. You may want to copy everything you can off the USB Key first as the following fix wipes and re-flashes the USB Key.
These didn’t work:
MDPT (Multi-Device Production Tool)
HP USB Disk Storage Format Tool
ChkFlsh.exe (in whatever destructive write mode I could find)
Running Virus scans etc.
Format (via the cli or gui)
The following worked! 🙂 ->
While researching this USB Read-Only bug/issue/problem I encountered the program “ChipGenius” (local mirror) which provides detailed information on the memory chip and manufacturer of the USB Pen Drive. This revealed the keyword “Alcor”, however searching for this only revealed foreign language websites and no help.
ChipGenius did however provide the VID and PID numbers I needed for the final solution.
Onto the Solution. As on the superuser.com website, you need the following program: “AlcorMP_5T2F_6T2F_2011-11-10.02“. Google for it (or use this local mirror).
Run the ChipGenius Program and locate the VID and PID Numbers (see image)
Extract the AlcorMP_…rar File (mirror above) and run LoadDriver.exe Enter the VID and PID and click Install, which only takes a second to run. (see image)
Unplug and Re-Plug in the USB Key
Run the AlcorMP.exe utility. To the left of the Device listed, click the Gray button and click “Start”. (see image)
It took about 2.5 hours to complete, most of which was scanning for bad blocks.
As for what caused the USB Key to go into a Read-Only state, it may have been the fact of unplugging it while in use or some other reason. (This USB key was actually been used on a saorview box to record and pause tv, so it may have caused this problem again in combination with unplugging the tv box instead of powering it off.)
What I was most surprised about was the difficulty in discovering this solution on the Internet. There was so much junk suggested which didn’t work. Hopefully this article will help other people in a similiar situation.
Building complex SQL queries for a particular database can take some time and effort. SQL-Drill is a simple Excel Add-in which can connect to a SQL Server or MySQL Database, show all the tables, and allow you to easily pick what columns you want to select data from. It will take care of the inner selects and joins, and will give you the final SQL query (which you can use in SQL Server Management Studio for reports etc.)
Run as Administrator – a Command Prompt regsvr32 “C:\Program Files (x86)\SQL Drill\SQLDrill.dll”
Open Excel. The Add-Ins tab should now show, and in this Tab, will be “SQL Drill”
Connect with SQL Server
Connecting to SQL Server is very easy. Click the New/Edit, Add a new Profile, Edit the Connection String, choose “Microsoft OLE DB Provider for SQL Server” click next, enter the server name, and login details (or SA details). Clicking “Test Connection” should return “Test connection succeeded”.Connect SQL-Drill to Microsoft SQL Server
Connect with MySQL Server
Connecting SQL-Drill with MySQL Server is a little more involved than connecting to Microsoft SQL Server. There are two main Steps. One is setting up the ODBC Connection in the Windows ODBC Data Sources. Two is using this connection inside of SQL-Drill.
Download and install the MySQL ODBC Connector (I had to install both mysql-connector-odbc-5.1.10-winx64.msi and mysql-connector-odbc-5.1.10-win32.msi as I was on Win7 x64 with Excel x32)
START -> Search/Run -> odbcad32 This should open the “ODBC Data Source Administrator” app. (Also accessible from: Control Panel – Administrative Tools – Data Sources (ODBC))
Under “User DSN”, choose Add. Choose “MySQL ODBD 5.1 Driver”, and click Finish.
In the MySQL Connector/ODBC, enter the Connection details. Click Test and it should return “Test Successful”.
Open up Excel. Open up SQLDrill. Click the New/Edit, Add a new Profile, Edit the Connection String, choose “Microsoft OLE DB Provider for ODBC Drivers” click next. Under “Use data source name” click the drop-down, and the earlier ODBC connection should be there. Clicking “Test Connection” should return “Test connection succeeded”.
SQL-Drill is very easy to use. After connecting, all the tables are shown on the right. Drag and drop tables into the workspace. Tick the columns you want data from; the select query will be visible, and you can execute the query.
SQL-Drill worked great for a SQL Server Database as it identified all foreign keys and relationships between the tables. As a result it made intelligent select statements.
For MySQL however, sql drill didn’t identify multiple foreign keys and as a result did not have the relationship between the tables. As a result for MySQL, it did not create intelligent select statements (i.e. with Joins and inner selects).SQL-Drill Usage on a SQLServer DB showing the relationships identified between tables.
Posted inUncategorized|Taggedmssql, MySQL|Comments Off on SQL Drill – Excel Add-In for building and running SQL queries