Friday, July 27, 2007

Attaching to network printer without directory or dns assistance

If you visit another company's office and connect your laptop to their windows network, you'll find that you aren't a member of their domain which can make a lot of typical office activities a bit more difficult to achieve. Printing is a biggie.

First step is to find out from someone on the domain what the ip address of the printer is. Get them to bring up the Printer Properties dialog and go to the Sharing tab. The printer will have a sharing name. Pinging the sharing name from the command prompt will give you the ip address.

Now you can Add Printer. Here's where is gets a bit counterintuitive: you select Local Printer (not Network Printer - I always thought local meant directly connected to your PC, but there are more options in this wizard path than I realised). Select Create a New Port and choose Standard TCP/IP Port. Enter the IP address (the port will be completed for you).

Then you have to select the Manufacturer and Model. My experience has been that if I choose something in the ballpark then plain old document printing will usually work. e.g. the model HP Laserjet 4000 Series PS provides printing for a HP Laserjet 4345 mfp printer, but its other fancy features may be unavailable.

The guidance out there on the web is to choose PS first followed by PCL6 followed by PCL if confronted with multiple similar choices.

SSIS development notes

Mirror any settings you change in the package in your development package configuration. Otherwise you risk the config values blatting your changes.

Click OK to save transformation changes, don't just close the editor!

When tidying up the dtsConfig xml formatting, don't put newlines and tabs between the ConfiguredValue tags.

This error:

Error at Create x Table [DTS.Pipeline]: The index is not valid.ADDITIONAL INFORMATION:Exception from HRESULT: 0xC0048004 (Microsoft.SqlServer.DTSPipelineWrap)

just means that SSIS is playing up. Recreate the offending data source (I wonder if any of the service packs fix this?)

When copying and pasting data flow elements, unselect the copied elements before pasting.

You've added a dozen package variables in the wrong scope, and the scope can't be edited in the variable view. Aaargh! Do you have to delete and recreate them? No, you can open the code designer view of the package, find the xml for the variables and move them to the appropriate place. It's not really much easier I'm afraid.

When columns are added to the data source, the Union All transformation fails to recognise their existence. This transformation has to be recreated.

If you're developing on a virtual machine that has been created by restoring from a windows backup, the first tab of the Regional and Language Options control panel may revert back to US English. Changing all the settings on the front tab will get your usual desktop apps behaving properly, but SSIS may still be confused! If you have a SQL task that calls a stored procedure with a date parameter, you may find that the sp will receive a date in the wrong format. The way to fix this is to select the Default User Account Settings tick box on the Advanced tab of the Regional and Language Options control panel.

When executing solutions or packages within Visual Studio I get duplicate designer windows opening up. The icons for these dupes are the same as for miscellaneous files. The main nuisance is if after execution I decide to make further changes and I mistakenly change the dupes instead of the originals. What are these windows for?

Thursday, July 26, 2007

Restoring windows backup didn't restore all regional and language options

Strange, restoring into a vanilla os from a backup file didn't bring across the regional settings on the first tab of Regional and Language Options.

I only noticed this because I hit a documented SSIS error.

Wednesday, July 25, 2007

SQL Server 2005, Visual Studio 2005 and Visual Studio 2005 SP1

If you have installed both SQL Server 2005 and Visual Studio 2005 then probably both of the following will be installed:

Microsoft Visual Studio 2005 Premier Partner Edition - ENU
Microsoft Visual Studio 2005 X Edition - ENU

Sure it's untidy that the VS2005 X install doesn't detect and replace Premier, but it hasn't caused any problems (so far). If you're like me, you haven't dared remove Premier because you're worried about regression, and probably you just use X because it is a superset of Premier anyway.

However now it's time to put Visual Studio 2005 SP1 on. What's it going to do?

It asked me if I want to install on Premier. But I don't use Premier! Oh no, it's chosen the wrong one! I cancelled the installation and to my surprise it then asked if I wanted to install on X? Phew! But now I'm not sure if I need to install on Premier also. Considering it's supposed to take a minimum of 90 minutes, do I really want to sit through that twice?

I decided to install only on X, and hit a "digital signature check" error. This post describes the fix for a software stack that's very similar to mine.

More P2V travails

Before restoring from backup I changed the registry for intelppm.sys as per previous posting. The settings didn't revert on restore so the stop error went away.

Since stop errors that require registry fixes are a nuisance to sort out, it's tempting to preemptively disable intelppm.sys and processr.sys as part of the basic steps, immediately after firing up the restore vmc.

The runtime error I posted about previously was solved by repairing dotnetframework2.0. Not really sure why it broke. Probably for the same reason I was prompted for the dotnetfx install during the Win2K3 repair.

Tuesday, July 24, 2007

Better (but probably not best) practice for Windows/Virtual PC P2V

Basic steps:

Back up the physical system to a bkf file
Create a vanilla vhd using the operating system of the physical system
Make a copy of the vanilla vhd to a restore vhd
Create an empty backup vhd
Mount the backup vhd using vhdmount
Copy the bkf file into the backup vhd (might need to compact or split it)
Unmount the backup vhd
Configure a vmc with restore vhd as disc 1 and backup vhd as disc 2
Fire up the vmc and restore the backup
Reboot, cross fingers and troubleshoot device issues

If there are issues:

Configure another vmc with the vanilla vhd as disc 1 and restore vhd as disc 2

Fire up the vmc and use windows tools to copy required files, edit offline registry etc

Don't faff around with recovery console or utility boot discs more than necessary - it's all a big pain and you'll end up having to juggle various iso's and vfd's.

Monday, July 23, 2007

Getting big files into vhds via vhdmount

Having trouble using or copying big files from shared folders or linked drives because of throughput or memory constraints?

Mount a disc ,and copy in your files, then unmount and commit changes. Vhdmount then takes a loooong time merging undo discs, but at least it works!

Windows explorer integration for vhdmount helps out a lot with this.

I find this a great way to get image or backup files into blank vhds. I partition with the appropriate windows setup cd and then do a quick-format as prompted on mounting the vhd, followed by the file copy.

My experience is that if the file is really big (say 10GB) then at the end of the copy it will sit there saying "5 seconds remaining" for a long time. I haven't been patient enough to let it sit for a day to see if it completes, but there's very little activity of any kind so I think it just dies.