The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,861 other subscribers

Archive for 2010

StarTeam 2005 on Windows 2003 Server using MSDE: service dependencies

Posted by jpluimers on 2010/08/24

Recently, I had to restore StarTeam 2005 on a Windows 2003 Server.

An out-of-the-box install using MSDE 2000 does not want to run as a service.

This post shows you how I solved that problem. Read the rest of this entry »

Posted in Database Development, Development, MSDE 2000, Power User, Software Development, Source Code Management, SQL Server, SQL Server 2000, StarTeam, Windows, Windows Server 2003 | Leave a Comment »

Nokia Ovi Suite 2.2.0.241 clears Nokia 6700 classic when updating from v09.70 to v10.50 #fail

Posted by jpluimers on 2010/08/23

I had a really bad experience using Nokia Ovi Suite 2.2.0.241 to update my Nokia 6700 classic phone from v09.70 to v10.50.

This is what I did:

  1. Make a backup on my Nokia 6700 classic in NBF format
  2. Copy the NBF backup file to a safe place
  3. Install Nokia Ovi Suite 2.2.0.241 on a fully patched Windows 7 Ultimate x64 on a ThinkPad T61p
  4. Connect my Nokia 6700 classic to Ovi
  5. Start the process of updating the firmware of my Nokia 6700 classic
  6. Ask Ovi to make a backup of my Nokia 6700 classic first
  7. Finish updating the firmware of my Nokia 6700 classic
  8. Allow Ovi to restore the backup it made
  9. Reboot the phone, enter PIN, etc

Now the phone is blank: everything was wiped off, the backup restauration failed. Read the rest of this entry »

Posted in Power User | Leave a Comment »

Solution for “Error Code: 0x80246002” on Microsoft Update when installing “Microsoft .NET Framework 4 for Windows Server 2003 x86 (KB982671)”

Posted by jpluimers on 2010/08/20

When you write .NET 4 software, you want to deploy it to your clients, so they need to install the .NET Framework 4.

On fully patched Windows Server 2003 x86 installations, the (optional) Windows Update for Microsoft .NET Framework 4 for Windows Server 2003 x86 (KB982671) usually results in this error:

Installation Failure

Error Code: 0x80246002

Try to install the update again, or request help from one of the following resources.

It fails during download, so it does not even reach the install phase.
Don’t loose too much time resolving this: The usual solution for 0x80246002 as described in KB958056 does not work.
The systems affected don’t have anti-virus or similar software installed, so disabling those won’t work: there is nothing to disable.

What does work is the suggestion a bit lower in the 0x80246002 update fails search results Read the rest of this entry »

Posted in .NET, Delphi, Development, Power User, Prism, Software Development | 8 Comments »

SQL Sever: batch files to find instances and sqlcmd.exe/osql.exe

Posted by jpluimers on 2010/08/19

In my VM’s, I often run different instances and/or versions of SQL Server.

Finding the right instance of SQL server, and the right version of SQLCMD.EXE / OSQL.EXE can be a pain.

That’s why I have written the two batch-files shown below for that.
They are not perfect, but they do work for me, and show a few interesting batch-file tricks.

As for preferring SQLCMD: [WayBack] sql server – What are the differences between osql, isql, and sqlcmd? – Stack Overflow

find-sql-sqlcmd.bat

This finds the most up-to-date SQLCMD.EXE (or OSQL.EXE for SQL Server 2000) and puts the location of it in the sqlcmd environment variable.

@echo off
rem find the highest version of SQLCMD.EXE or OSQL.EXE and put it in the sqlcmd environment variable
rem this prefers SQLCMD.EXE over OSQL.EXE

set sqlcmd=

for %%d in ("%ProgramFiles%", "%ProgramFiles(x86)%") do for %%v in (80, 90, 100) do for %%f in (OSQL, SQLCMD) do (
call :sqlcmdtest "%%~d\Microsoft SQL Server\%%v\Tools\Binn\%%f.EXE" %1
)

if !!==!%sqlcmd%! for %%f in (OSQL, SQLCMD) do (
call :find-on-path %%f.EXE
)

if !%1!==!! echo SQLCMD: %sqlcmd%
goto :exit

rem be carefull not to specify the .EXE in the %%f FOR loop-expression, otherwise it tries to dine SQLCMD.EXE and OQSL.EXE in the current directory

rem http://msdn.microsoft.com/en-us/library/ms178653.aspx
rem 80 = SQL Server 2000
rem 90 = SQL Server 2005
rem 100 = SQL Server 2008 and 2008 R2

:find-on-path
set sqlcmd=%~f$PATH:1
if not ""=="%sqlcmd%" set sqlcmd="%sqlcmd%"
goto :exit

:sqlcmdtest
if exist %1 if !%2!==!! echo found %1
if exist %1 set sqlcmd=%1

:exit

Tricks used:

  1. Clearing an environment varible by asigning an empty string to it
    (set sqlcmd=)
  2. Nested for loops
    Note that when working with string literals in for loops, you should not put any file extension on it (if you do, the for loop will only match filenames).
    So: In stead of having (OSQL.EXE, SQLCMD.EXE), you see (OSQL, SQLCMD) in the for loop, and the .EXE is concatenated later on.
  3. Splitting the body of the for loop over multiple lines using parenthesis ().
  4. Put the value you prefer at the end of the for loop
    (so the last value that is found will be put in the sqlcmd environment variable)
  5. The mapping of SQL Server verions to numbers used in the directories (see also the documentation of the SQL Server sp_dbcmptleve stored procedure):
    80 = SQL Server 2000
    90 = SQL Server 2005
    100 = SQL Server 2008

find-sql-instance.bat

This batch file finds the SQL Server instances on the local machines from the naming of the SQL Server services that are running.
Note that it won’t work if you choose custom names for your SQL Server services (but that will probably break a lot of other stuff out there as well).

@echo off
rem find best matching instance of SQL Server on this machine
set sqlinstance=
set sqlservice=
for /f "usebackq tokens=1,2,3 delims=:$" %%i in (`sc query`) do (
rem %%j is " MSSQL" because we dropped space as a delimiter
if "%%i"=="SERVICE_NAME" call :bare-service %%j %%k
)
if !%1!==!! echo SQL Instance=%sqlinstance%
if !%1!==!! echo SQL Service=%sqlservice%
goto :exit

:bare-service
rem %1 equals "MSSQL" because of the command-line parsing trims spaces
rem the order is important: we favour named instances over unnamed:
if "%1"=="MSSQLSERVER" call :process-instance %1 .
if "%1"=="MSSQL" call :process-instance MSSQL$%2 .\%2
goto :exit

:process-instance
if !%1!==!! echo found service "%1" providing instance "%2"
if "%sqlinstance%"=="" set sqlinstance=%2& set sqlservice=%1
for /f "usebackq tokens=1,2,3,4" %%s in (`sc query %1`) do (
if "%%s"=="STATE" if !%1!==!! echo state of %1 is %%v
)
goto :exit

:exit

Tricks used:

  1. use the for /f command to parse the output of sc query;
    note the use of the usebackq, tokens and delims parameters in this command,
    and the use of `backquotes` to parse the output of `sc query` which outputs fragments like shown below.
  2. Use the ampersand (&) to run two commands on one line
    (the set sqlinstance=%2 and set sqlservice=%1).
  3. the sc query command, which queries the Service Controller for the configured services
  4. The use of call :bare-service to call a subroutine at label :bare-service inside a for loop
  5. The fact that a leading space in for loop variable %%j is trimmed when calling the :bare-service label.

sc query sample fragment:

SERVICE_NAME: MSSQL$SQLEXPRESS
DISPLAY_NAME: SQL Server (SQLEXPRESS)
        TYPE               : 10  WIN32_OWN_PROCESS
        STATE              : 4  RUNNING
                                (STOPPABLE,PAUSABLE,ACCEPTS_SHUTDOWN)
        WIN32_EXIT_CODE    : 0	(0x0)
        SERVICE_EXIT_CODE  : 0	(0x0)
        CHECKPOINT         : 0x0
        WAIT_HINT          : 0x0

SQLRUN – tying it together

My final batch-file ties both together:

set sqlrun=
call %~dp0sql-find-sqlcmd.bat %*
call %~dp0sql-find-instance.bat %*
if not !!==!%sqlcmd%! if not !!==!%sqlinstance%! set sqlrun=%sqlcmd% -S %sqlinstance% -E
if !%1!==!! echo SQLRUN=%sqlrun%

The output of that batch-file is like this:

found "C:\Program Files\Microsoft SQL Server\90\Tools\Binn\OSQL.EXE"
found "C:\Program Files\Microsoft SQL Server\90\Tools\Binn\SQLCMD.EXE"
found "C:\Program Files\Microsoft SQL Server\100\Tools\Binn\OSQL.EXE"
found "C:\Program Files\Microsoft SQL Server\100\Tools\Binn\SQLCMD.EXE"
SQLCMD: "C:\Program Files\Microsoft SQL Server\100\Tools\Binn\SQLCMD.EXE"
found ".\SQLEXPRESS"
state of service MSSQL$SQLEXPRESS with SQL Server instance .\SQLEXPRESS is RUNNING
found "MSSQLSERVER" (.)
state of service MSSQLSERVER with SQL Server instance . is RUNNING
SQL Instance=.\SQLEXPRESS
SQLRUN="C:\Program Files\Microsoft SQL Server\100\Tools\Binn\SQLCMD.EXE" -S .\SQLEXPRESS -E

Hope this helps a few people.

–jeroen

Posted in CommandLine, Database Development, Development, Software Development, SQL Server | 8 Comments »

Speaking at Delphi Live 2010 USA and EKON 14 Germany

Posted by jpluimers on 2010/08/18

Next week, I’ll be speaking at Delphi Live 2010 in San Jose, California., USA.
At the end of september, I’ll be speaking at EKON 14, in Darmstadt, Germany. My 14th appearance at EKON!

Delphi Live (sessions in English):

EKON 14 (Sessions auf Deutsch / in German):

Hope tho see some of you people at one of those events.

I will bring some USB audio equipment, so I might do a bit of geek stuff doing ASIO audio on those events too.

–jeroen

Posted in Conferences, Delphi, DelphiLive, Development, EKON, Event, Software Development | 5 Comments »

Allen Bauer sheds more light on the goal of the 64-bit support level for Delphi, and the goal of the x64 Delphi and x64 C++ release time frames

Posted by jpluimers on 2010/08/17

On the Embarcadero forum, Jolyon Smith asked about the underlying meaning of the 64-bit Pulsar statements in the updated Roadmap.
He did not ask for an exact date, but what level of 64-support is the current goal.

Allen Bauer (Chief Scientist at Embarcadero) was kind enough to put up a few answers.

A few quotes are below, please read the full thread titled Embarcadero Discussion Forums: Roadmap: Clarification Required Please … for the exact answers.
It basically boils down to this: Read the rest of this entry »

Posted in Delphi, Development, Software Development | 9 Comments »

x64 support in ESXi4.1 requires VT, I know that! but why warn so late?

Posted by jpluimers on 2010/08/16

I know that ESXi 4.1 requires VT (the Intel support for hardware assisted virtualization) to be enabled to run x64 VMs.
This is the warning that you get when starting an x64 VM, and you don’t have VT enabled:

[Window Title]
Virtual Machine Message
[Main Instruction]
Virtual Machine Message
msg.cpuid.noLongmodeQuestionFmt: This virtual machine is configured for 64-bit guest
operating systems. However, 64-bit operation is not possible.
This host is VT-capable, but VT is disabled.
VT might be disabled if it has been disabled in the BIOS settings or the host has not been
power-cycled since changing this setting.
(1) Verify that the BIOS settings enable VT and disable ‘trusted execution.’
(2) Power-cycle the host if either of these BIOS settings have been changed.
(3) Power-cycle the host if you have not done so since installing VMware ESX.
(4) Update the hosts’s BIOS to the latest version.
For more detailed information, see http://vmware.com/info?id=152
Continue without 64-bit support?
[Yes] [No] [OK]

Read the rest of this entry »

Posted in BIOS, Boot, ESXi4, Hardware, HP XW6600, Power User, Virtualization, VMware, VMware ESXi | 3 Comments »

Veeam FastSCP on ESXi 4.1: “API version on the server does not allow CreateDirectory operation” -> Upgrade to 3.0.3

Posted by jpluimers on 2010/08/13

Last week, I wrote Veeam Backup and Replication on ESXi 4.1: “Input string was not in a correct format.” -> Upgrade to 4.1.2

I was partially wrong in that Veam Backup FastSCP 3.0.2.270 did not work: that the alternative is Veeam Backup and Replication 4.1.2.
Well not completely: Veeam Backup and Replication 4.1.2 works, but a day after they released that 4.1.2 version, they also released Veeam Backup and FastSCP 3.0.3, which works too.
And of course they released it about half a day after I wrote the above post :-) Read the rest of this entry »

Posted in ESXi4, Power User, Veeam, VMware | 2 Comments »

TomTom Lifetime Maps/Traffic Subscription: should I do it?

Posted by jpluimers on 2010/08/12

I’m considering a TomTom Lifetime Maps/Traffic Subscription on a TomTom XXL 540 World Traveler’s Edition Series.

But given section 7 “Subscriptions (for Lifetime Maps/Traffic, see subparagraphs f and g only)” of their General Terms and Conditions (see below) – especially the underlined pieces below – I’m hesitating.

I have the gut feeling the same can happen with that device that happened with my HTC Advantage X7500 PDA:
it runs TomTom 6, since TomTom 7 does not support this PDA (might have to do with the 640×480 resolution of the PDA).
Newer maps don’t run on TomTom 6, so I’m stuck with old (Europe and USA) maps.

This TomTom XXL 540 WTE system is only available in the USA (not over here in Europe), and since I’ll be speaking at DelphiLive in less than 2 weeks from now: well, you’ll get my point :-)

I can’t seem to find out if this model has 4Gb or 2Gb memory; so anyone who knows that, please place a coment.
Also the screen resolution seems to be 480 x 272 (I’m used to 640 x 480), so I will probably need to get used to that if I buy.

So: Any opinions on what you think the map support lifetime of this XXL 540 WTE navi will be? Read the rest of this entry »

Posted in Opinions, Power User | Leave a Comment »

.NET: the TFS / Visual Studio mix: connecting from VS2008 to TFS2010 and CodePlex

Posted by jpluimers on 2010/08/11

Lately, CodePlex is in the progress of [WayBackmigrating from TFS2008 to TFS2010 (they [Archive.ishave done TFS05…TFS01 and TFS07; TFS06 and TFS08…TFS10 still need to be done).

When your projects have been migrated (or you are going to use TFS2010 yourself), and you use VS2008 (or VS2005 – which I have not tested yet), you need to perform some updates and configuration changes to connect to the new TFS2010 servers.

So this post is about connecting from VS2008 to TFS2010 on CodePlex.
The tips will also work when connecting to a regular TFS2010 server: the connection URL is slightly different. Read the rest of this entry »

Posted in .NET, CodePlex, Development, Software Development, Source Code Management, TFS (Team Foundation System) | Leave a Comment »