Wednesday, July 27, 2005

RE: Import/Export to Excel

Every now and then, I need to send stuff from SQL to Excel....

Apart from using DTS and Import/Export wizard, we can also use this query to export data from SQL Server2000 to Excel and vice versa

Create an Excel file named testing having the headers same as that of table columns and use this query

insert into OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=D:\testing.xls;',
'SELECT * FROM [SheetName$]') select * from SQLServerTable

To export data from Excel to new SQL Server table,

select *
into SQLServerTable FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=D:\testing.xls;HDR=YES',
'SELECT * FROM [Sheet1$]')

To export data from Excel to existing SQL Server table,

Insert into SQLServerTable Select * FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=D:\testing.xls;HDR=YES',
'SELECT * FROM [SheetName$]')


[Via SQLJunkies Blogs]

Friday, July 15, 2005

I've been looking for a way to hack Google Earth

Google Earth is cool. They took an excellent product called Keyhole and bought the company last year. The first resulsts of that were the satelite image detail available in Google Maps. Then they recently release Google Earth in three versions, two paid, one free. The free version is pretty powerful and lets you create animations on the screen, but you can't save the output as a video file.

I created a DVD last year from the video I shot in China when we brought Laura home and I want to update that video with our flight plan. The current version of the video uses some static maps with flight paths drawn on them, very low tech. It would be really cool to use Google Earth to generate the video of the flight path, but you need the commerical version ($400 a year) to export video. I figured it was a matter of time before someone would hack a way around this. And sure enough, someone (David Scotch) did.

It appears to be pretty straight forward, but I haven't tried it yet. You need to install a program that can save the video in memory to a file. In David's blog article, he used FRAPS. The free version of Fraps will watermark the image, but it should be a good test to see if it works. He then used VirtualDub to edit the video and reduce the size.

Thursday, July 14, 2005

RE: Skype and Port 80

Here's a good tip to remember if you are using Skype and doing web developement...
I was having trouble with my IIS on my local machine -- namely, it wouldn't start.  That's not good, because I do a lot of ASP.NET development, etc.  Well, the reason it wouldn't a start was “EventID 15: Cannot bind” something or other.   A poke around the Internet told me to check to see if there was another application bound to good old port 80.  A tool called ActivePorts told me that good ol' Skype was blocking out Port 80, and not allowing IIS to start.  Interesting.  So I went to the Skype options, and then to the Connection tab, and found the interesting “Use Port 80 as an alternative for incoming connections”.  Bingo -- disabled that “feature”, and IIS was back up and running. 

[Via Nick's Delphi Blog]

Tuesday, July 12, 2005

Eric's Advice For First-Time Technical Presenters

Eric Lippert has posted some really good advice for doing presentations in front of a large audience.

Keyboard Shortcuts in a Remote Desktop Session

From the Windows XP Resource Kit

You can apply Windows key combinations to your Remote Desktop sessions, or you can use the following Remote Desktop keyboard shortcuts to perform many of the same functions.



Windows Key Combinations for Client ComputerEquivalent Keys for Remote Desktop SessionDescription
ALT+TABALT+PAGE UPSwitches between programs from left to right.
ALT+SHIFT+TABALT+PAGE DOWNSwitches between programs from right to left.
ALT+ESCALT+INSERTCycles through the programs in the order they were started.
 CTRL+ESCSwitches the client between a window and full screen.
CTRL+ESCALT+HOMEDisplays the Start menu.
 ALT+DELETEDisplays the Windows menu.
PRINT SCREENCTRL+ALT+MINUS (–) symbol on the numeric keypadPlaces a snapshot of the active window in the Remote Desktop session on the clipboard.
CTRL+ALT+DELCTRL+ALT+ENDDisplays the Task Manager or Windows Security dialog box. (Only use CTRL+ALT+END to issue this command. CTRL+ALT+DEL is always interpreted by the client computer.)
ALT+PRINT SCREENCTRL+ALT+PLUS (+) symbol on the numeric keypadPlaces a snapshot of the entire Remote Desktop session window on the clipboard.

Friday, July 08, 2005

RE: The Observer Pattern

Dave Burke has a pretty good description of how to use the Observer pattern. I'll skip into the gory details, you find that on the link to his article. It describles how you coordinate multiple views of the same set of data in the user interface.

It's another way to describe the subscriber/publisher model. Your data publishes events when something changes (the user views a different record, changes the ordeing, etc) and the various UI elements that subscribe to the data will get the events. Once they get that event, they can determine if action is rtequired for their view of the data.

It's one of those things that when you see it, you think "That makes sense, why didn't I do it that way."

Wednesday, July 06, 2005

Free advice from a lawyer

Handy advice from a lawyer who writes from his own experience, a passalong email.

Your checks
  • When next you order checks, have only the initials of your first name printed. If someone takes your checkbook, they will not know if you sign your checks with just your initials or your first name, but your bank will know how you sign your checks

  • Never have your social security number printed on your check. You can always add it if necessary.

  • Put your work phone number on your checks instead of your home phone. If you have a PO Box use that instead of your home address. If you do not have a PO Box, use your work address.

  • When you are writing checks to pay on your credit card accounts, DO NOT put the complete account number on the "For" line. Instead, just put the last four numbers. The credit card company knows the rest of the number, and anyone who might be handling your check as it passes through all the check processing channels won't have access to it.


  • Your wallet
  • Place the contents of your wallet on a photocopy machine. Do both sides of each license, credit card, etc. You will know what you had in your wallet and all of the account numbers and phone numbers to call and cancel. While youre at it, make a photocopy of your passport.

  • Next to each card, write down the toll free number to call if the card is stolen. Dont forget the number to the Registry of Motor Vehicles

  • Keep the photocopy in a safe place. Thieves work fast. The key to stopping them and limiting your damage - is to cancel cards quickly.


  • If your wallet is stolen
  • File a police report immediately where it was stolen. This proves to credit providers that you were diligent and its the first step toward an investigation if there is one.

  • Report your cards stolen and cancel them. Believe me, you will be SO glad you made that photocopy

  • Call the three national credit reporting organizations to place a fraud alert on your name and social security number. This prevents thieves from applying for credit cards in your name. Such an alert means any company that checks your credit knows your information was stolen and they have to contact you by phone to authorize new credit.


  • Here are the numbers you need. Keep this with the photocopy of your credit cards.

    1. Equifax: 1-800-525-6285
    2. Experian (formerly TRW): 1-888-397-3742
    3. Trans Union: 1-800-680-7289
    4. Social Security Administration (fraud line): 1-800-269-0271 ?

    [courtesy of Business of Life]

    RE: Speed Surfer? Get a 'Local' Homepage

    This is a clever idea, I think I'm going to do this on the home PC's. I'll add links to email and of course, Amazon. I'm always curious about the status of the wireless bridges that I plugged the Tivo's into, I can add links to them as well.

    Rather than use 'google' as my "homepage" I always create my own html file to use as a webpage, and store it on my hard drive.

    Advantage are:

    1. It loads damn quick, even loads when you're not online.
    2. You can customise it easily.

    Here's an example:

    snippet of my local homepage

    This is my gift to you.

    My "real" homepage also has links to the banks I use, and so on. I only ommited that stuff because you are a pack of prying thieves.


    [Via secretGeek]