Search This Blog

Monday, March 15, 2010

Table Variable Example

DECLARE @ProductTotals TABLE
(
ProductID int,
Revenue money
)

Friday, March 12, 2010

VB6 Form_queryUnload Event unloadmode argument

From Microsoft

Visual Basic Reference

QueryUnload Event

See Also    Example    Applies To
Occurs before a form or application closes. When an MDIForm object closes, the QueryUnload event occurs first for the MDI form and then in all MDI child forms. If no form cancels the QueryUnload event, the Unload event occurs first in all other forms and then in an MDI form. When a child form or a Form object closes, the QueryUnload event in that form occurs before the form's Unload event.
Syntax
Private Sub Form_QueryUnload(cancel As Integer, unloadmode As Integer)
Private Sub MDIForm_QueryUnload(cancel As Integer, unloadmode As Integer)
The QueryUnload event syntax has these parts:
Part Description
cancel An integer. Setting this argument to any value other than 0 stops the QueryUnload event in all loaded forms and stops the form and application from closing.
unloadmode A value or constant indicating the cause of the QueryUnload event, as described in Return Values.

Return Values
The unloadmode argument returns the following values:
Constant Value Description
vbFormControlMenu 0 The user chose the Close command from the Control menu on the form.
vbFormCode 1 The Unload statement is invoked from code.
vbAppWindows 2 The current Microsoft Windows operating environment session is ending.
vbAppTaskManager 3 The Microsoft Windows Task Manager is closing the application.
vbFormMDIForm 4 An MDI child form is closing because the MDI form is closing.
vbFormOwner 5 A form is closing because its owner is closing.

Monday, March 1, 2010

Get file name from path

I cannot remember this....

 System.IO.Path.GetFileName(filepath)

its IO.Path not IO.Directory or IO.File