Wednesday, December 08, 2004

Extract MSI files from EXE

Most applications come packaged as a single EXE file which contains the MSI & CAB files. In order to deploy these applications using Group policy the individual files need to be extracted:

To extract:
file.exe /t::\Folder /c

You can also apply updates to existing applications. Firstly extract the msp file as above.

To patch:
msiexec /a msifile.msi /p mspfile.msp


N.B. In the case of a number of applications (such as office) you first need to create an administrative installation point by running setup with the '/a' switch.

In the case of office further customization can be performed by using the office resource kit, available at link.

Wednesday, December 01, 2004

ASP.NET, Datagrid, Textbox, Formatting

Link

I used the above link & created a single formatting function which replaced certain characters (such as vbcrlf) with their HTML equivilents. This was placed in a standard module.

Function ConvertToHTML(ByVal arg As Object) As String
Dim strTemp As String
strTemp = Replace(arg, vbCrLf, "BR")
Return strTemp
End Function


The databinding for the label control (the control which displays the data rather than editing it) was then modified from:
DataBinder.Eval(Container, "DataItem.TaskComments") to ConvertToHTML(DataBinder.Eval(Container, "DataItem.TaskComments"))

The aspx page cannot read a module function, producing the error 'Function not declared'. The solution to this was to create a wrapper function in the code behind page.

Public Function ConvertToHTML(ByVal arg As Object) As String
Return modFunctions.ConvertToHTML(arg)
End Function

Tuesday, November 30, 2004

SQL Mail: EXCEPTION_ACCESS_VIOLATION

Link

This appears to be a problem with later versions of SQL Mail (SP2, SP3). Try reverting to the SP1 release of sqlmap70.dll. This might solve the problem.

Thursday, November 25, 2004

IBM x-series Server Will Not Boot From CD

If the integral CDROM drive is configured as a slave drive in this machine, it will not be able to boot from a CD. It must be the master drive in order to boot.


Wednesday, November 24, 2004

Access Denied, ASP.NET, Domain Controller, Identity Impersonate

Access Denied, ASP.NET, Domain Controller, Identity Impersonate

If attempting to run an ASP.NET application from a web server which is also a domain controller you may encounter an 'Access Denied' error message, when the application uses indentity impersonation...

Wednesday, October 27, 2004

Tuesday, October 26, 2004

Intranet site is identified as an Internet site when you use an FQDN or an IP address

Intranet site is identified as an Internet site when you use an FQDN or an IP address

When attempting to open an access file using a FQDN it is incorrectly identified as an internet site.
http://support.microsoft.com/?id=303650

Friday, October 22, 2004

DCPROMO: failed to modify the necessary properties for machine account

DCPROMO: failed to modify the necessary properties for machine account

Discussion Thread
Microsoft Article

Tuesday, October 19, 2004

SQL Server 2000 Operations Guide: Capacity Planning

SQL Server 2000 Operations Guide: Capacity Planning

Link

Wednesday, October 13, 2004

Register DLL with Right-Click

http://www.mydesktophelp.com/tips/t3.htm
This .REG file allows DLL/OCX files to be registered with a simple right-click.

Debug Stored Procedure: EXCEPTION_ACCESS_VIOLATION

Debug Stored Procedure: EXCEPTION_ACCESS_VIOLATION

Link

asp:textbox format

You cannot include DataFormatString in an asp:textbox like you can an asp:boundcolumn. However, you can format it in the binding expression as shown in the link:
DataBinder.Eval(Container, "DataItem.DateRequired", "{0:d}")

SQL Parameter Possibly Null

I needed to include a date column in my datagrid which could possible be null. I therefore had to insert null, or the value entered by the user if appropriate. I wrote a small function which created the parameter:

Function CreateSQLDateParam(ByRef Name As String, ByRef Val As String) As SqlParameter
Dim SQL_P As SqlParameter
SQL_P = New SqlParameter(Name, SqlDbType.DateTime)
If Val <> "" Then
SQL_P.Value = CDate(Val)
Else
SQL_P.Value = DBNull.Value
End If
Return SQL_P
End Function

Setting DataGrid Textbox

Setting DataGrid Textbox to current date by default.

I needed to set a textbox control within a datagrid footer to display the current date by default. This is the solution I found after a little research. I used the DataGrid_ItemCreated event:

Private Sub DataGrid_ItemCreated(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles DataGrid.ItemCreated
Dim strTemp As String = "TextBox"
Dim temptext As TextBox
temptext = e.Item.FindControl(strTemp)
If Not temptext Is Nothing Then
temptext.Text = Date.Today
End If
End Sub