.NET Questions and Solutions

As a software engineer, I focus on .NET, especially asp.net, C#, WCF and so on, and I am also very interested in Search Engine Optimization.

Entries for July, 2011

“Type Mismatch” error message when you run a VBA macro in a 64-bit version of an Office 2010 application

Symptoms
Assume that you have a Microsoft Visual Basic for Applications (VBA) macro that runs correctly on a 32-bit version of a Microsoft Office application. However, this VBA macro does not run correctly in a 64-bit version of?a Microsoft Office 2010 application in a 64-bit version ofWindows.
Typically, this problem occurs when the VBA macro uses some Microsoft ActiveX Data Objects (ADO) APIs that are platform-dependent.?For example, you run a VBA macro that uses the RecordCount property of an ADO Recordset object in a way that resembles the following:

Dim rs as ADODB.Recordse
LONG recordCount

recordCount = rs.RecordCountIn this example, you receive a “Type Mismatch” error message when you run this macro on a 64-bit version of an Office 2010 application.
NotesYou can install the 64-bit version of Office 2010 in the following Windows operating systems:64-biteditions of Windows Server 2003 Service Pack 2 that haveMSXML 6.0 installedx64-based editions of Windows Vista Service Pack 1 and later versions64-biteditions of Windows Server 2008 and later versionsx64-based editions of Windows 7Windows Server 2008 R2?To view a list of ADO APIs that are platform dependent,?see the “More information” section.
Resolution
Some ADO APIs are platform dependent in ADO 2.7 and later versions. On 64-bit versions of?Windows, these ADO APIs process arguments by using a 64-bit data type (such as the LONGLONG data type). However, applications that use these APIs still use the LONG data type. Therefore, you receive a “Type Mismatch” error message when you try to run the macro.

“Net statistics server” output displays incorrect time

Symptoms
If you run the command “Net Statistics Server” from a Command Prompt on a Windows Server 2008 system with or without Service Pack 1 or Service Pack 2 installed, the output is displayed as follows:
Server Statistics for \\Computer_Name
Statistics since 1/1/1980 12:00:00 AM
The time stamp “1/1/1980 12:00:00 AM” continues to remain the same even if the server was recently rebooted or the server service on the server was recently restarted.
Resolution
This is a limitation of this command on Windows Server 2008 with or without Service Pack 1 or Service Pack 2. This command gives the desired output on systems running Windows Server 2003, Windows Server 2003 R2 and Windows Server 2008 R2. By contrast, the command “Net Statistics Workstation” gives the desired results on Windows Server 2008 with or without Service Pack 1 or 2.

“0×0000007E” Stop error when you create snapshots in Windows Server 2008 or in Windows Vista

Symptoms
On a computer that is running Windows Server 2008 or Windows Vista, you receive the following Stop error message when you create a snapshot of a volume:?

STOP: 0×0000007E (parameter1, parameter2, parameter3, parameter4)
SYSTEM_THREAD_EXCEPTION_NOT_HANDLED Notes The parameters in this error message vary, depending on the configuration of the computer.Not all “0×0000007E” Stop errors are caused by this issue.For example, you receive this Stop error message after you enable Volume Shadow Copy Service on a volume for a secondary Data Protection Manager (DPM) server.
Resolution
This issue occurs because of a race condition in the Volume Shadow Copy Service driver (Volsnap.sys).
When the volume size is being changed in the snapshot creation process, the race condition might be encountered.