Saturday, April 15, 2017

SQL Server OPENROWSET Excel using Microsoft.ACE.OLEDB

This on SQL Server 2016:

Download file AccessDatabaseEngine_X64.exe from Microsoft Access Database Engine 2010 Redistributable

Open an Administrator Command Window and install with the following command:

C:\Users\kaushalsinha\Downloads\AccessDatabaseEngine_X64.exe /passive

/passive switch is the key.

Once installed, the query in SQL Server Management Studio:

sp_configure 'show advanced options', 1;
sp_configure 'Ad Hoc Distributed Queries', 1;

EXEC sp_MSset_oledb_prop N'Microsoft.ACE.OLEDB.12.0', N'AllowInProcess', 1;
EXEC sp_MSset_oledb_prop N'Microsoft.ACE.OLEDB.12.0', N'DynamicParam', 1;

FROM OPENROWSET('Microsoft.ACE.OLEDB.12.0','Excel 12.0 Xml;HDR=YES;Database=F:/2011-12 CRDC/SCH/data for Schools/Pt 1-Enrollment/Overall Enrollment.xlsx','SELECT * FROM [Suppressed Data$]');

... and the result:


Sunday, June 1, 2014

Why my next phone won't be a Motorola

Contrary to what Motorola/Google will have you believe, you can apparently get bootloader of your Motomaker MotoX unlocked by some person in china by paying him/her $45.

What that means is that this person has access to some/all of your personal information. He certainly has access to your MEID number which is supposed to a global unique number for each Mobile device.

I have yet to receive any formal notification from Motorola regarding my information being compromised partially/completely. I am going lodge a complaint with FTC and see if they can find if another corporation is trying to mislead it's customers. I am still suffering as a result of that Target data breach. Hopefully, I don't have to go through changing my credit card info at 15 different sites again!

Ever since I started using a "smartphone", I have only used Motorola phones(DroidX, X2, RAZR Maxx, MotoX), guess, it's time to switch device once iPhone 6 is out :)

Sunday, February 3, 2013

Windows 8: File Access Denied

Wanted to try some Windows Phone 8 App development, so Microsoft forced me to install Windows 8 on one of my partitions since you can install WP8 SDK only on Windows 8 OS.

That's stupid on Microsoft part, when you come up with a new Mobile platform and want developers to build apps for your platform, you want to make it easier for them and NOT create stupid roadblocks in the way. But, I guess, that's why the response to Windows Phone 8 is less than expected at best.

Anyways, now on to more Windows 8 stupidity:

I am logged in to my machine as an administrator (heck, I am the only user) and I am trying to copy a file from one of my other machines on the network to a local drive and I get this message.

File Access Denied
You require permission from computer's administrator to make changes to this file.

Again, I am logged in as an administrator, so what gives.

Anyway, after a little googling, I did find a solution to the problem.

Open the command prompt with elevated privileges by clicking the Start orb, All Programs, Accessories, right-click Command Prompt and then select Run as administrator.

Type the following command:
net user administrator /active:yes

Type the following command to Map the network drive:
net use K: \\[Machine Name]\[Share Name] /u:[UserName]

Once, that's done you should be able to copy files.

Monday, November 19, 2012

Enabling generic SATA AHCI in Windows 7

After you use the BIOS setup of a Windows 7-based computer or a Windows Vista-based computer to change the Serial Advanced Technology Attachment (SATA) mode of the boot drive to use either the Advanced Host Controller Interface (AHCI) specification or redundant array of independent disks (RAID) features, you receive the following error message when the computer is restarted: 


Thursday, August 16, 2012

Installing sqlite3 binary on Android RAZR MAXX (Running ICS)

Download SuperOneClick from cnet

You will need adnroid sdk tools, I am using version 10

A rooted RAZR Maxx with ICS

Turn on "USB Debugging" on your phone.

Copy sqlite3 binary from the SuperOneClick package above to the SD Card of your phone.

The open a command window and change directory to wherever you have extracted the sdk tools zipped file.
Then run the following commands

adb shell
mount -o remount,rw -t yaffs2 /dev/mtdblock3 /system
cp /mnt/sdcard-ext/sqlite3 /system/bin
chmod 4755 /system/bin/sqlite3
mount -o remount,ro -t yaffs2 /dev/mtdblock3 /system

.. and you are done.
I needed to do this to use sqlite to turn on the Mobile Hotspot on my phone.

Wednesday, December 21, 2011

Windows 7 Backup with DriveImage XML

Recently go a new Dell Latitude E5420 and wanted to use the machine with dual boot option (XP and Win 7) . Have already been using DriveImage XML to take full system image backup (and restore) on Windows XP for a couple of years now, so wanted to see if you can do the same thing with Windows 7.

Turns out, in Windows 7 you can create a system image and restore the whole system with the windows 7 installation disk.

There are problems though:
  • In Home Premium edition ( the one that came pre-installed on my laptop) , you cannot exclude your windows xp partition from your system image, which makes my backup size more than double and takes twice as much time too.
  • "Restore" from the the installation disk will wipeout all the partition and recreate the partition map to what it used to be whne you created the system image. That means, any other OS partition will be completely gone/over-written.
These are major issues AFAIAC, hopefully, Microsoft will make their process better in subsequent Windows OS.

Anway, creating a System image using DriveImage was easy enough.
Run something like this will create an image on an external USB drive:
"C:\Program Files\Runtime Software\DriveImage XML\dixml.exe" /bc /tG:\Images\KAUSHAL /r- /s- /c /v

And then used the Ultimate Boot CD for Windows to restore the Windows 7 partition.
Did run into "boot error" after the restore, then, runnng the following fixed the issue:

Boot with Windows 7 disc, Choose "Repair Option", Click on Command Prompt.
  • Type C: ( or drive where Windows 7 is installed ) and press <Enter>.
  • At the C:\ prompt, type cd boot and press <Enter>.
  • At the C:\Boot prompt, type the following commands and press Enter after each command.
bootrec /RebuildBcd
bootrec /FixMbr
bootrec /FixBoot
That should fix boot problems.

Tuesday, September 27, 2011

Deleting The Dreaded _vti_cnf folders recursively Created by FrontPage

Recently installed the FrontPage extension on my old Windows XP box. Turns out, each of the folder under C:\Inetpub\wwwroot directory now has a folder called _vti_cnf .
It doesn't hurt anything, just annoying.

If you have Windows Powershell installed, you're lucky. Just open a Powershell window and issue the following commands:

cd C:\Inetpub\wwwroot

Get-ChildItem $RootDir "_vti_cnf" -recurse | Remove-Item -recurse

That's it, it's all gone.