2 Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
3 Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX"
4 Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
5 Object = "{0ECD9B60-23AA-11D0-B351-00A0C9055D8E}#6.0#0"; "MSHFLXGD.OCX"
6 Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
8 BorderStyle = 1 'Fixed Single
9 Caption = "DB2 Visual Basic Samples"
19 StartUpPosition = 3 'Windows Default
20 Begin VB.CommandButton cmdSample
21 Caption = "Create Sample DB"
29 Begin TabDlg.SSTab tabMain
41 TabCaption(0) = "Execute SQL"
42 TabPicture(0) = "Demo.frx":0000
43 Tab(0).ControlEnabled= -1 'True
44 Tab(0).Control(0)= "flxRecords"
45 Tab(0).Control(0).Enabled= 0 'False
46 Tab(0).Control(1)= "txtSQL"
47 Tab(0).Control(1).Enabled= 0 'False
48 Tab(0).Control(2)= "frmAutoCommit"
49 Tab(0).Control(2).Enabled= 0 'False
50 Tab(0).Control(3)= "cmdCommit"
51 Tab(0).Control(3).Enabled= 0 'False
52 Tab(0).Control(4)= "cmdRollback"
53 Tab(0).Control(4).Enabled= 0 'False
54 Tab(0).Control(5)= "chkAutoCommit"
55 Tab(0).Control(5).Enabled= 0 'False
56 Tab(0).Control(6)= "DataGridSQL"
57 Tab(0).Control(6).Enabled= 0 'False
58 Tab(0).Control(7)= "frmSamples"
59 Tab(0).Control(7).Enabled= 0 'False
60 Tab(0).Control(8)= "frmExecuteSQL"
61 Tab(0).Control(8).Enabled= 0 'False
62 Tab(0).Control(9)= "cmdSQLConnection"
63 Tab(0).Control(9).Enabled= 0 'False
64 Tab(0).Control(10)= "cmdSQLRecordset"
65 Tab(0).Control(10).Enabled= 0 'False
66 Tab(0).Control(11)= "cmdSQLCommand"
67 Tab(0).Control(11).Enabled= 0 'False
68 Tab(0).Control(12)= "cmdSQLSamples(0)"
69 Tab(0).Control(12).Enabled= 0 'False
70 Tab(0).Control(13)= "cmdSQLSamples(1)"
71 Tab(0).Control(13).Enabled= 0 'False
72 Tab(0).Control(14)= "cmdSQLSamples(2)"
73 Tab(0).Control(14).Enabled= 0 'False
74 Tab(0).Control(15)= "cmdSQLSamples(3)"
75 Tab(0).Control(15).Enabled= 0 'False
76 Tab(0).ControlCount= 16
77 TabCaption(1) = "Hierarchical Data"
78 TabPicture(1) = "Demo.frx":001C
79 Tab(1).ControlEnabled= 0 'False
80 Tab(1).Control(0)= "cmdHierarchy"
81 Tab(1).Control(1)= "hflxRecords"
82 Tab(1).Control(2)= "lblHierScript"
83 Tab(1).ControlCount= 3
84 TabCaption(2) = "LOBs"
85 TabPicture(2) = "Demo.frx":0038
86 Tab(2).ControlEnabled= 0 'False
87 Tab(2).Control(0)= "lblEmpno"
88 Tab(2).Control(1)= "lblLastname"
89 Tab(2).Control(2)= "lblFirstname"
90 Tab(2).Control(3)= "AdodcLob"
91 Tab(2).Control(4)= "cmdCLOB"
92 Tab(2).Control(5)= "cmdBLOB"
93 Tab(2).Control(6)= "cmdRefresh"
94 Tab(2).Control(7)= "txtEmpno"
95 Tab(2).Control(7).Enabled= 0 'False
96 Tab(2).Control(8)= "txtLastname"
97 Tab(2).Control(8).Enabled= 0 'False
98 Tab(2).Control(9)= "txtFirstname"
99 Tab(2).Control(9).Enabled= 0 'False
100 Tab(2).Control(10)= "txtClob"
101 Tab(2).Control(10).Enabled= 0 'False
102 Tab(2).Control(11)= "picBlob"
103 Tab(2).ControlCount= 12
104 TabCaption(3) = "Store Procedures"
105 TabPicture(3) = "Demo.frx":0054
106 Tab(3).ControlEnabled= 0 'False
107 Tab(3).Control(0)= "optStoredProcedures(11)"
108 Tab(3).Control(1)= "cmdShowSecondRS"
109 Tab(3).Control(2)= "DataGridSP"
110 Tab(3).Control(3)= "txtSPResult"
111 Tab(3).Control(4)= "cmdSPCall"
112 Tab(3).Control(5)= "optStoredProcedures(10)"
113 Tab(3).Control(6)= "optStoredProcedures(9)"
114 Tab(3).Control(7)= "optStoredProcedures(8)"
115 Tab(3).Control(8)= "optStoredProcedures(7)"
116 Tab(3).Control(9)= "optStoredProcedures(6)"
117 Tab(3).Control(10)= "optStoredProcedures(5)"
118 Tab(3).Control(11)= "optStoredProcedures(4)"
119 Tab(3).Control(12)= "optStoredProcedures(3)"
120 Tab(3).Control(13)= "optStoredProcedures(2)"
121 Tab(3).Control(14)= "optStoredProcedures(1)"
122 Tab(3).Control(15)= "optStoredProcedures(0)"
123 Tab(3).Control(16)= "frmStoredProcedures"
124 Tab(3).ControlCount= 17
125 TabCaption(4) = "UDFs"
126 TabPicture(4) = "Demo.frx":0070
127 Tab(4).ControlEnabled= 0 'False
128 Tab(4).Control(0)= "cmdUDFs(5)"
129 Tab(4).Control(1)= "cmdUDFs(4)"
130 Tab(4).Control(2)= "cmdUDFs(3)"
131 Tab(4).Control(3)= "cmdUDFs(2)"
132 Tab(4).Control(4)= "cmdUDFs(1)"
133 Tab(4).Control(5)= "cmdUDFs(0)"
134 Tab(4).Control(6)= "hflxGridUDF"
135 Tab(4).Control(7)= "txtUDF"
136 Tab(4).Control(7).Enabled= 0 'False
137 Tab(4).Control(8)= "Frame1"
138 Tab(4).ControlCount= 9
139 Begin VB.CommandButton cmdSQLSamples
149 Begin VB.CommandButton cmdSQLSamples
159 Begin VB.CommandButton cmdSQLSamples
169 Begin VB.CommandButton cmdSQLSamples
179 Begin VB.CommandButton cmdUDFs
189 Begin VB.CommandButton cmdUDFs
190 Caption = "SourcedColumnUDF"
199 Begin VB.CommandButton cmdUDFs
200 Caption = "ScUDFReturningErr"
209 Begin VB.CommandButton cmdUDFs
210 Caption = "ScratchpadScUDF"
219 Begin VB.CommandButton cmdUDFs
220 Caption = "ClobScalarUDF"
229 Begin VB.CommandButton cmdUDFs
230 Caption = "ScalarUDF"
239 Begin MSHierarchicalFlexGridLib.MSHFlexGrid hflxGridUDF
255 Begin VB.TextBox txtUDF
263 Strikethrough = 0 'False
269 ScrollBars = 2 'Vertical
275 Begin VB.Frame Frame1
276 Caption = "Work with UDF:"
283 Begin VB.OptionButton optStoredProcedures
284 Caption = "MAIN_EXAMPLE"
293 Begin VB.CommandButton cmdShowSecondRS
294 Caption = "Show Next RS"
302 Begin MSDataGridLib.DataGrid DataGridSP
317 AllowAddNew = -1 'True
318 AllowDelete = -1 'True
319 BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
320 Name = "MS Sans Serif"
326 Strikethrough = 0 'False
328 BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
329 Name = "MS Sans Serif"
335 Strikethrough = 0 'False
338 BeginProperty Column00
341 BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
351 BeginProperty Column01
354 BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
366 BeginProperty Column00
368 BeginProperty Column01
372 Begin VB.TextBox txtSPResult
380 Strikethrough = 0 'False
389 Begin VB.CommandButton cmdSPCall
398 Begin VB.OptionButton optStoredProcedures
399 Caption = "DBINFO_EXAMPLE"
408 Begin VB.OptionButton optStoredProcedures
409 Caption = "DB2SQL_EXAMPLE"
418 Begin VB.OptionButton optStoredProcedures
419 Caption = "CLOB_EXTRACT"
428 Begin VB.OptionButton optStoredProcedures
429 Caption = "TWO_RESULT_SETS"
438 Begin VB.OptionButton optStoredProcedures
439 Caption = "ONE_RESULT_SET"
448 Begin VB.OptionButton optStoredProcedures
449 Caption = "DECIMAL_TYPE"
458 Begin VB.OptionButton optStoredProcedures
459 Caption = "ALL_DATA_TYPES"
468 Begin VB.OptionButton optStoredProcedures
469 Caption = "INOUT_PARAM"
478 Begin VB.OptionButton optStoredProcedures
479 Caption = "OUT_PARAM"
488 Begin VB.OptionButton optStoredProcedures
489 Caption = "IN_PARAMS"
498 Begin VB.OptionButton optStoredProcedures
499 Caption = "OUT_LANGUAGE"
508 Begin VB.Frame frmStoredProcedures
509 Caption = "Stored Procedure:"
516 Begin VB.CommandButton cmdSQLCommand
517 Caption = "on Command"
525 Begin VB.CommandButton cmdSQLRecordset
526 Caption = "on Recordset"
534 Begin VB.CommandButton cmdSQLConnection
535 Caption = "on Connection"
543 Begin VB.Frame frmExecuteSQL
544 Caption = "Execute SQL"
551 Begin VB.Frame frmSamples
558 Begin MSDataGridLib.DataGrid DataGridSQL
571 AllowAddNew = -1 'True
572 AllowDelete = -1 'True
573 BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
574 Name = "MS Sans Serif"
580 Strikethrough = 0 'False
582 BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
583 Name = "MS Sans Serif"
589 Strikethrough = 0 'False
592 BeginProperty Column00
595 BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
605 BeginProperty Column01
608 BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
620 BeginProperty Column00
622 BeginProperty Column01
626 Begin VB.CheckBox chkAutoCommit
627 Caption = " AutoCommit"
636 Begin VB.CommandButton cmdRollback
645 Begin VB.CommandButton cmdCommit
654 Begin VB.Frame frmAutoCommit
661 Begin VB.PictureBox picBlob
662 BackColor = &H80000005&
672 Begin VB.TextBox txtClob
680 Strikethrough = 0 'False
692 Begin VB.TextBox txtFirstname
694 BackColor = &H80000013&
704 Begin VB.TextBox txtLastname
706 BackColor = &H80000013&
716 Begin VB.TextBox txtEmpno
718 BackColor = &H80000013&
728 Begin VB.CommandButton cmdRefresh
729 Caption = "Refresh Data"
737 Begin VB.CommandButton cmdBLOB
738 Caption = "Show Picture"
746 Begin VB.CommandButton cmdCLOB
747 Caption = "Show Resume"
755 Begin VB.CommandButton cmdHierarchy
764 Begin VB.TextBox txtSQL
772 Strikethrough = 0 'False
777 ScrollBars = 2 'Vertical
782 Begin MSHierarchicalFlexGridLib.MSHFlexGrid hflxRecords
798 Begin MSHierarchicalFlexGridLib.MSHFlexGrid flxRecords
814 Begin MSAdodcLib.Adodc AdodcLob
824 ConnectionTimeout= 15
836 BackColor = -2147483643
837 ForeColor = -2147483640
849 BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
850 Name = "MS Sans Serif"
856 Strikethrough = 0 'False
860 Begin VB.Label lblHierScript
861 Caption = $"Demo.frx":008C
862 ForeColor = &H80000011&
869 Begin VB.Label lblFirstname
870 Caption = "First Name:"
877 Begin VB.Label lblLastname
878 Caption = "Last Name:"
885 Begin VB.Label lblEmpno
886 Caption = "Employee No.:"
894 Begin VB.CommandButton cmdVersionInfo
895 Caption = "Get Environment Info"
903 Begin VB.CommandButton cmdConnectInfo
904 Caption = "Get Connection Info"
912 Begin VB.CommandButton cmdConnectDataShape
913 Caption = "Connect DataShape"
920 Begin VB.CommandButton cmdConnectODBC
921 Caption = "Connect ODBC"
928 Begin VB.CommandButton cmdDisconnect
929 Caption = "Disconnect"
937 Begin VB.CommandButton cmdConnectOLEDB
938 Caption = "Connect OLE DB"
945 Begin VB.Frame frmConnection
946 Caption = "Connection:"
953 Begin VB.CommandButton cmdExit
961 Begin VB.Frame fmExit
968 Begin MSComctlLib.StatusBar sbrStatus
969 Align = 2 'Align Bottom
978 BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628}
980 BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628}
985 BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
986 Name = "MS Sans Serif"
992 Strikethrough = 0 'False
995 Begin VB.Frame frmEnvironment
996 Caption = "Environment:"
1004 Attribute VB_Name = "frmMain"
1005 Attribute VB_GlobalNameSpace = False
1006 Attribute VB_Creatable = False
1007 Attribute VB_PredeclaredId = True
1008 Attribute VB_Exposed = False
1009 '---------------------------------------------------------------------------
1011 ' Licensed Materials - Property of IBM
1012 ' Governed under the terms of the IBM Public License
1014 ' (C) COPYRIGHT International Business Machines Corp. 2002
1015 ' All Rights Reserved.
1017 ' US Government Users Restricted Rights - Use, duplication or
1018 ' disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
1019 '---------------------------------------------------------------------------
1021 ' SOURCE FILE NAME: Demo.frm
1023 ' SAMPLE: Visual Basic Demo with user interface for the sample modules
1037 ' For more information about samples, refer to the README file.
1039 ' For more information on the SQL language, refer to the SQL Reference.
1041 ' For the latest information on programming, compiling, and running DB2
1042 ' applications, refer to the DB2 application development website at
1043 ' http://www.software.ibm.com/data/db2/udb/ad
1044 '---------------------------------------------------------------------------
1048 Private con As ADODB.Connection
1049 Private rst As ADODB.Recordset
1050 Private strMsgText As String
1051 Private wShowInstructions As Integer
1053 'This procedure calls ConnectOLEDB() in the module dbConn to get
1054 'a connection object.
1055 Private Sub cmdConnectOLEDB_Click()
1056 'define the error handler
1057 ' On Error GoTo cmdConnectOLEDB_Error
1059 'connect to database
1060 Set con = ConnectOLEDB()
1062 'generate a message of success
1063 sbrStatus.Panels(1).Text = "Connect to sample database succeeded!"
1065 'config status of the buttons
1069 If wShowInstructions = vbYes Then
1070 ShowConnectionInstruction
1073 cmdConnectOLEDB_Exit:
1076 cmdConnectOLEDB_Error:
1077 'generate an error message
1078 sbrStatus.Panels(1).Text = "ERROR: " & Err.Description
1081 If wShowInstructions = vbYes Then
1082 MsgBox "Connect to sample database failed!" & vbCr & _
1083 Err.Description & vbCr & _
1084 "Please correct the problem and try again.", _
1085 vbOKOnly + vbCritical, "Instruction"
1088 Resume cmdConnectOLEDB_Exit
1091 'This procedure calls ConnectODBC() in the module dbConn to get
1092 'a connection object.
1093 Private Sub cmdConnectODBC_Click()
1094 'define the error handler
1095 On Error GoTo cmdConnectODBC_Error
1097 'connect to database
1098 Set con = ConnectODBC()
1100 'generate a message of success
1101 sbrStatus.Panels(1).Text = "Connect to sample database succeeded!"
1103 'config status of the buttons
1107 If wShowInstructions = vbYes Then
1108 ShowConnectionInstruction
1111 cmdConnectODBC_Exit:
1114 cmdConnectODBC_Error:
1115 'generate an error message
1116 sbrStatus.Panels(1).Text = "ERROR: " & Err.Description
1119 If wShowInstructions = vbYes Then
1120 MsgBox "Connect to sample database failed!" & vbCr & _
1121 Err.Description & vbCr & _
1122 "Please correct the problem and try again.", _
1123 vbOKOnly + vbCritical, "Instruction"
1126 Resume cmdConnectODBC_Exit
1129 'This procedure calls ConnectDataShape() in the module dbConn to
1130 'get a connection object.
1131 Private Sub cmdConnectDataShape_Click()
1132 'define the error handler
1133 On Error GoTo cmdConnectDataShape_Error
1135 'connect to database
1136 Set con = ConnectDataShape()
1137 con.Attributes = adXactCommitRetaining + adXactAbortRetaining
1139 'generate a message of success
1140 sbrStatus.Panels(1).Text = "Connect to sample database succeeded!"
1142 'config status of the buttons
1144 cmdHierarchy.Enabled = True
1145 lblHierScript.ForeColor = vbButtonText
1148 If wShowInstructions = vbYes Then
1149 ShowConnectionInstruction
1152 cmdConnectDataShape_Exit:
1155 cmdConnectDataShape_Error:
1156 'generate an error message
1157 sbrStatus.Panels(1).Text = "ERROR: " & Err.Description
1160 If wShowInstructions = vbYes Then
1161 MsgBox "Connect to sample database failed!" & vbCr & _
1162 Err.Description & vbCr & _
1163 "Please correct the problem and try again.", _
1164 vbOKOnly + vbCritical, "Instruction"
1167 Resume cmdConnectDataShape_Exit
1170 'This procedure enables buttons after a connection is created.
1171 Private Sub EnableButtons()
1172 Dim tmpButton As CommandButton
1173 cmdConnectOLEDB.Enabled = False
1174 cmdConnectODBC.Enabled = False
1175 cmdConnectDataShape.Enabled = False
1176 cmdHierarchy.Enabled = False
1177 lblHierScript.ForeColor = vbGrayText
1178 cmdSample.Enabled = False
1179 cmdConnectInfo.Enabled = True
1180 cmdVersionInfo.Enabled = True
1181 cmdDisconnect.Enabled = True
1182 cmdRefresh.Enabled = True
1183 cmdSQLConnection.Enabled = True
1184 cmdSQLRecordset.Enabled = True
1185 cmdSQLCommand.Enabled = True
1186 For Each tmpButton In cmdSQLSamples
1187 tmpButton.Enabled = True
1189 cmdCommit.Enabled = False
1190 cmdRollback.Enabled = False
1191 chkAutoCommit.Enabled = True
1192 CheckAvailableStoredProcedures
1193 For Each tmpButton In cmdUDFs
1194 tmpButton.Enabled = True
1198 'This procedure shows the instruction message after creating a connection.
1199 Private Sub ShowConnectionInstruction()
1200 MsgBox "Connect to sample database succeeded!" & vbCr & _
1201 "You may choose a Tab for specific functional demonstration," & vbCr & _
1202 "or press one of the info buttons for more information.", _
1203 vbOKOnly, "Instruction"
1206 'This procedure calls Disconnect() in the module dbConn to close
1207 'a connection object.
1208 Private Sub cmdDisconnect_Click()
1209 'define the error handler
1210 On Error GoTo cmdDisconnect_Error
1212 'clear displays and release data sources
1214 Set DataGridSQL.DataSource = Nothing
1215 Set hflxRecords.DataSource = Nothing
1216 DataGridSQL.ClearFields
1218 picBlob.Visible = False
1221 txtLastname.Text = ""
1222 txtFirstname.Text = ""
1223 AdodcLob.Caption = ""
1224 chkAutoCommit.Value = 1
1225 DataGridSP.Visible = False
1226 txtSPResult.Text = ""
1230 'disconnect from database
1231 sbrStatus.Panels(1).Text = Disconnect(con)
1233 'configure status of the buttons
1234 Dim tmpButton As CommandButton
1235 cmdConnectOLEDB.Enabled = True
1236 cmdConnectODBC.Enabled = True
1237 cmdConnectDataShape.Enabled = True
1238 cmdSample.Enabled = True
1239 cmdDisconnect.Enabled = False
1240 cmdHierarchy.Enabled = False
1241 lblHierScript.ForeColor = vbGrayText
1242 cmdConnectInfo.Enabled = False
1243 cmdVersionInfo.Enabled = False
1244 cmdSQLConnection.Enabled = False
1245 cmdSQLRecordset.Enabled = False
1246 cmdSQLCommand.Enabled = False
1247 For Each tmpButton In cmdSQLSamples
1248 tmpButton.Enabled = False
1250 cmdCommit.Enabled = False
1251 cmdRollback.Enabled = False
1252 chkAutoCommit.Enabled = False
1253 cmdRefresh.Enabled = False
1254 cmdBLOB.Enabled = False
1255 cmdCLOB.Enabled = False
1256 AdodcLob.Enabled = False
1257 cmdSPCall.Enabled = False
1258 CheckAvailableStoredProcedures
1259 For Each tmpButton In cmdUDFs
1260 tmpButton.Enabled = False
1264 If wShowInstructions = vbYes Then
1265 MsgBox "Sample Database is disconnected!" & vbCr & _
1266 "You may now choose one of the connections again.", _
1267 vbOKOnly, "Instruction"
1275 cmdDisconnect_Error:
1276 'generate an error message
1277 sbrStatus.Panels(1).Text = "ERROR: " & Err.Description
1280 If wShowInstructions = vbYes Then
1281 MsgBox "Disconnect from sample database failed!" & vbCr & _
1282 Err.Description & vbCr & _
1283 "Please correct the problem and try again.", _
1284 vbOKOnly + vbCritical, "Instruction"
1287 Resume cmdDisconnect_Exit
1290 'This procedure calls ConnectInfo in dbInfo to obtain information
1291 'and displays the connection information on a message box.
1292 Private Sub cmdConnectInfo_Click()
1293 sbrStatus.Panels(1).Text = ""
1294 MsgBox ConnectInfo(con), vbOKOnly, "Connection Information"
1297 'This procedure calls VersionInfo in apInfo to obtain information
1298 'and displays the version information on a message box.
1299 Private Sub cmdVersionInfo_Click()
1300 sbrStatus.Panels(1).Text = ""
1301 MsgBox VersionInfo(con), vbOKOnly, "Versions Information"
1304 'This procedure close the main screen and quit the program.
1305 Private Sub cmdExit_Click()
1306 'check if it is necessary to commit any changes
1307 chkAutoCommit.Value = 1
1309 'release all the memory allocated
1310 Set hflxRecords.DataSource = Nothing
1311 Set DataGridSQL.DataSource = Nothing
1319 'This procedure calls CreateSample in Util to re-create the
1321 Private Sub cmdSample_Click()
1322 'define the error handler
1323 On Error GoTo cmdSample_Error
1325 'create the sample database
1326 sbrStatus.Panels(1).Text = "Creating the sample database, please wait..."
1328 sbrStatus.Panels(1).Text = "Create the sample database is done."
1331 If wShowInstructions = vbYes Then
1332 MsgBox "The sample database has been created!" & vbCr & _
1333 "You may now choose one of the connections.", _
1334 vbOKOnly, "Instruction"
1341 'generate an error message
1342 sbrStatus.Panels(1).Text = "ERROR: " & Err.Description
1345 If wShowInstructions = vbYes Then
1346 MsgBox "Create sample database failed!" & vbCr & _
1347 Err.Description & vbCr & _
1348 "Please correct the problem and try again.", _
1349 vbOKOnly + vbCritical, "Instruction"
1352 Resume cmdSample_Exit
1355 'This procedure calls ExecuteSQLConnect in apExeSQL to execute a
1357 Private Sub cmdSQLConnection_Click()
1358 'define the error handler
1359 On Error GoTo cmdSQLConnection_Error
1361 'display results and/or message
1362 DataGridSQL.ClearFields
1363 Set rst = ExecuteSQLConnect(txtSQL, strMsgText, con)
1364 Set DataGridSQL.DataSource = rst
1365 sbrStatus.Panels(1).Text = strMsgText
1367 cmdSQLConnection_Exit:
1370 cmdSQLConnection_Error:
1371 'generate an error message and exit
1372 sbrStatus.Panels(1).Text = "ERROR: " & Err.Description
1373 Resume cmdSQLConnection_Exit
1376 'This procedure calls ExecuteSQLCommand in apExeSQL to execute a
1378 Private Sub cmdSQLCommand_Click()
1379 'define the error handler
1380 On Error GoTo cmdSQLCommand_Error
1382 'display results and/or message
1383 DataGridSQL.ClearFields
1384 Set rst = ExecuteSQLCommand(txtSQL, strMsgText, con)
1385 Set DataGridSQL.DataSource = rst
1386 sbrStatus.Panels(1).Text = strMsgText
1391 cmdSQLCommand_Error:
1392 'generate an error message and exit
1393 sbrStatus.Panels(1).Text = "ERROR: " & Err.Description
1394 Resume cmdSQLCommand_Exit
1397 'This procedure calls ExecuteSQLRecordset in apExeSQL to execute a
1399 Private Sub cmdSQLRecordset_Click()
1400 'define the error handler
1401 On Error GoTo cmdSQLRecordset_Error
1403 'display results and/or message
1404 DataGridSQL.ClearFields
1405 Set rst = ExecuteSQLRecordset(txtSQL, strMsgText, con)
1406 Set DataGridSQL.DataSource = rst
1407 DataGridSQL.SetFocus
1408 sbrStatus.Panels(1).Text = strMsgText
1410 cmdSQLRecordset_Exit:
1413 cmdSQLRecordset_Error:
1414 'generate an error message and exit
1415 sbrStatus.Panels(1).Text = "ERROR: " & Err.Description
1416 Resume cmdSQLRecordset_Exit
1419 'This procedure displays instructions for exiting recursive errors while
1420 'editing on the DataGird
1421 Private Sub DataGridSQL_Error(ByVal DataError As Integer, Response As Integer)
1422 If wShowInstructions = vbYes Then
1424 "If errors keep happening," & vbCr & _
1425 "You may press [Disconnect] to clear errors.", _
1426 vbOKOnly, "Instruction"
1428 sbrStatus.Panels(1).Text = "Press [Disconnect] to clear continuous errors."
1431 'This procedure generates a sample SQL statement
1432 Private Sub cmdSQLSamples_Click(Index As Integer)
1435 txtSQL.Text = "SELECT * FROM employee"
1437 txtSQL.Text = "SELECT firstnme, job, hiredate" & vbCrLf & _
1438 "FROM employee" & vbCrLf & _
1439 "WHERE workdept = 'D11'" & vbCrLf & _
1442 txtSQL.Text = "SELECT firstnme, job, salary + comm AS pay" & vbCrLf & _
1443 "FROM employee" & vbCrLf & _
1444 "WHERE (salary + comm) < 25000" & vbCrLf & _
1447 txtSQL.Text = "SELECT workdept," & vbCrLf & _
1448 " MAX(salary) AS maximum," & vbCrLf & _
1449 " MIN(salary) As minimum" & vbCrLf & _
1450 "FROM employee GROUP BY workdept ORDER BY workdept"
1455 'This procedure clears the results when choosing a predefined SQL
1457 Private Sub cmdSQLSamples_GotFocus(Index As Integer)
1458 Set DataGridSQL.DataSource = Nothing
1459 sbrStatus.Panels(1).Text = ""
1462 'This procedure toggles the autocommit mode on/off by calling
1463 'procedures in the module dbCommit.
1464 Private Sub chkAutoCommit_Click()
1465 'define the error handler
1466 On Error GoTo chkAutoCommit_Error
1468 If chkAutoCommit.Value = 0 Then
1469 'turn the autocommit mode OFF
1471 cmdCommit.Enabled = True
1472 cmdRollback.Enabled = True
1473 sbrStatus.Panels(1).Text = "AutoCommit mode is OFF."
1475 'ask if the user wants to commit all the previous changes
1476 'before turning the autocommit mode ON
1477 strMsgText = "Commit all previous changes (if any)?"
1478 If MsgBox(strMsgText, vbYesNo, "Turn Autocommit ON") = vbYes Then
1483 cmdCommit.Enabled = False
1484 cmdRollback.Enabled = False
1485 sbrStatus.Panels(1).Text = "AutoCommit mode is ON."
1492 chkAutoCommit_Error:
1493 'generate an error message and exit
1494 sbrStatus.Panels(1).Text = "ERROR: " & Err.Description
1495 Resume chkAutoCommit_Exit
1498 'This procedure commits any previous changes by calling
1499 'procedures in the module dbCommit.
1500 Private Sub cmdCommit_Click()
1501 'define the error handler
1502 On Error GoTo cmdCommit_Error
1504 'commit the changes and start a new transaction
1505 If chkAutoCommit.Value = 0 Then
1509 sbrStatus.Panels(1).Text = "Commit transactions succeeded."
1516 'generate an error message and exit
1517 sbrStatus.Panels(1).Text = "ERROR: " & Err.Description
1518 Resume cmdCommit_Exit
1521 'This procedure rollbacks any previous changes by calling
1522 'procedures in the module dbCommit.
1523 Private Sub cmdRollback_Click()
1524 'define the error handler
1525 On Error GoTo cmdRollback_Error
1527 'rollback the changes and start a new transaction
1528 If chkAutoCommit.Value = 0 Then
1532 sbrStatus.Panels(1).Text = "Rollback transactions succeeded."
1539 'generate an error message and exit
1540 sbrStatus.Panels(1).Text = "ERROR: " & Err.Description
1541 Resume cmdRollback_Exit
1544 'This is a helper procedure which refreshes the data displayed
1545 'on the DataGridSQL.
1546 Private Sub RefreshDataGridSQL()
1547 If Not DataGridSQL.DataSource Is Nothing Then
1548 Set DataGridSQL.DataSource = Nothing
1550 Set DataGridSQL.DataSource = rst
1554 'This procedure calls ExecuteHSQL() in the module dtHier to
1555 'obtain a hierarchical recordset object.
1556 Private Sub cmdHierarchy_Click()
1559 Set hflxRecords.DataSource = ExecuteHSQL(strMsgText, con)
1561 'display text information message
1562 sbrStatus.Panels(1).Text = strMsgText
1565 'This procedure calls GetLOB in dtLob to get an ADO Control for LOBs.
1566 Private Sub cmdRefresh_Click()
1567 'define the error handler
1568 On Error GoTo cmdRefresh_Error
1570 'get an ADO Control for the LOBs
1571 GetLOB con, AdodcLob
1574 'set display objects
1575 txtClob.DataField = "RESUME"
1576 Set txtClob.DataSource = AdodcLob
1577 picBlob.DataField = "PICTURE"
1578 Set picBlob.DataSource = AdodcLob
1579 txtEmpno.DataField = "EMPNO"
1580 Set txtEmpno.DataSource = AdodcLob
1581 txtLastname.DataField = "LASTNAME"
1582 Set txtLastname.DataSource = AdodcLob
1583 txtFirstname.DataField = "FIRSTNME"
1584 Set txtFirstname.DataSource = AdodcLob
1587 cmdBLOB.Enabled = True
1588 cmdCLOB.Enabled = True
1589 AdodcLob.Enabled = True
1595 'generate an error message and exit
1596 sbrStatus.Panels(1).Text = "ERROR: " & Err.Description
1597 AdodcLob.Enabled = False
1598 cmdBLOB.Enabled = False
1599 cmdCLOB.Enabled = False
1600 Resume cmdRefresh_Exit
1603 'This procedure enables the display of employee pictures.
1604 Private Sub cmdBLOB_Click()
1605 picBlob.Visible = True
1608 'This procedure enables the display of employee resumes.
1609 Private Sub cmdCLOB_Click()
1610 picBlob.Visible = False
1613 'This is a helper procedure for Adodc caption display.
1614 Private Sub AdodcLob_MoveComplete(ByVal adReason As ADODB.EventReasonEnum, ByVal pError As ADODB.Error, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset)
1615 AdodcLob.Caption = AdodcLob.Recordset.AbsolutePosition
1618 'This procedure checks and enables buttons for available stored
1620 Private Sub CheckAvailableStoredProcedures()
1621 Dim optStoredProcedure As Variant
1622 Dim proToken As ADOX.Procedure
1623 Dim pros As ADOX.Procedures
1625 'get information for all available procedures
1626 Set pros = GetProcedures(con)
1628 'reset all selections
1629 For Each optStoredProcedure In optStoredProcedures
1630 optStoredProcedure.Enabled = False
1631 optStoredProcedure.Value = False
1632 cmdShowSecondRS.Visible = False
1633 cmdSPCall.Enabled = False
1636 'enable buttons for available stored procedures
1637 For Each proToken In pros
1638 Select Case proToken.Name
1640 optStoredProcedures(0).Enabled = True
1642 optStoredProcedures(1).Enabled = True
1644 optStoredProcedures(2).Enabled = True
1646 optStoredProcedures(3).Enabled = True
1647 Case "ALL_DATA_TYPES"
1648 optStoredProcedures(4).Enabled = True
1650 optStoredProcedures(5).Enabled = True
1651 Case "ONE_RESULT_SET"
1652 optStoredProcedures(6).Enabled = True
1653 Case "TWO_RESULT_SETS"
1654 optStoredProcedures(7).Enabled = True
1656 optStoredProcedures(8).Enabled = True
1657 Case "DB2SQL_EXAMPLE"
1658 optStoredProcedures(9).Enabled = True
1659 Case "DBINFO_EXAMPLE"
1660 optStoredProcedures(10).Enabled = True
1662 optStoredProcedures(11).Enabled = True
1667 'enable Call button if any stored procedure available
1668 For Each optStoredProcedure In optStoredProcedures
1669 If optStoredProcedure.Enabled Then
1670 cmdSPCall.Enabled = True
1677 Set proToken = Nothing
1680 'This procedure clears the screen in switching the stored procedures
1681 Private Sub optStoredProcedures_Click(Index As Integer)
1682 sbrStatus.Panels(1).Text = ""
1683 txtSPResult.Text = ""
1684 If DataGridSP.Visible Then
1685 DataGridSP.Visible = False
1686 Set DataGridSP.DataSource = Nothing
1687 DataGridSP.ClearFields
1688 cmdShowSecondRS.Visible = False
1693 'This procedure calls various subroutines and subroutines in the
1694 'module spCall to execute corresponding stored procedures and
1695 'displays the results onto the screen.
1696 Private Sub cmdSPCall_Click()
1697 Dim optStoredProcedure As Variant
1698 Dim strParam As String
1700 'define the error handler
1701 On Error GoTo cmdSPCall_Error
1703 'check for the selected stored procedure by iteration
1704 For Each optStoredProcedure In optStoredProcedures
1705 If optStoredProcedure.Value = True Then
1710 'clear the screen for result display
1711 If IsObject(optStoredProcedure) Then
1712 sbrStatus.Panels(1).Text = ""
1713 txtSPResult.Text = ""
1714 DataGridSP.Visible = False
1716 sbrStatus.Panels(1).Text = "ERROR: No stored procedure selected."
1720 'call the corresponding selected stored procedure
1721 Select Case optStoredProcedure.Caption
1723 txtSPResult.Text = _
1724 "Stored procedures are implemented in LANGUAGE " & _
1725 CallSP_OUT_LANGUAGE(con)
1731 txtSPResult.Text = _
1732 "Stored Procedure OUT_PARAM calculated median was " & _
1733 CallSP_OUT_PARAM(con)
1736 Case "ALL_DATA_TYPES"
1739 txtSPResult.Text = _
1740 "Stored Procedure DECIMAL_TYPE returned value was " & _
1741 CallSP_DECIMAL_TYPE(con)
1743 txtSPResult.Text = _
1744 "Resume section returned from calling CLOB_EXTRACT:" & _
1745 vbCrLf & vbCrLf & CallSP_CLOB_EXTRACT(con)
1746 Case "ONE_RESULT_SET"
1747 Set DataGridSP.DataSource = CallSP_ONE_RESULT_SET(con)
1748 DataGridSP.Visible = True
1749 Case "TWO_RESULT_SETS"
1750 Set rst = CallSP_TWO_RESULT_SETS(con)
1751 Set DataGridSP.DataSource = rst
1752 DataGridSP.Visible = True
1753 cmdShowSecondRS.Visible = True
1754 cmdShowSecondRS.Enabled = True
1755 cmdShowSecondRS.SetFocus
1756 Case "DB2SQL_EXAMPLE"
1758 txtSPResult.Text = _
1759 "Stored Procedure DB2SQL_EXAMPLE returned value was " & _
1760 CallSP_DB2SQL_EXAMPLE(con, strParam) & _
1761 vbCrLf & "for the job of " & strParam & "."
1762 Case "DBINFO_EXAMPLE"
1765 strParam = "DESIGNER"
1766 txtSPResult.Text = _
1767 "Stored Procedure MAIN_EXAMPLE returned value was " & _
1768 CallSP_DB2SQL_EXAMPLE(con, strParam) & _
1769 vbCrLf & "for the job of " & strParam & "."
1772 'generate a message of success
1773 sbrStatus.Panels(1).Text = _
1774 "Stored Procedure " & optStoredProcedure.Caption & _
1775 " was called successfully."
1781 'generate an error message and exit
1782 sbrStatus.Panels(1).Text = "ERROR: " & Err.Description
1783 Resume cmdSPCall_Exit
1786 'This procedure shows the second result set returned by calling
1787 'the stored procedurd TWO_RESULT_SETS
1788 Private Sub cmdShowSecondRS_Click()
1789 'show next recordset
1790 Set DataGridSP.DataSource = rst.NextRecordset
1791 cmdShowSecondRS.Enabled = False
1795 'This procedure calls CallSP_IN_PARAMS in the module spCall and
1796 'compares information obtained from the same table before and
1797 'after calling the stored procedure
1798 Private Sub CallInParameters()
1799 'initialize variables
1800 Dim strSQL As String
1801 strSQL = "SELECT SUM(salary) FROM employee WHERE workdept = 'E11'"
1803 'get information before calling the stored procedure
1804 Set rst = ExecuteSQLCommand(strSQL, strMsgText, con)
1805 txtSPResult.Text = "Before calling IN_PARAMS, " & vbCrLf & _
1806 "Sum of salaries for dept. E11 = " & _
1807 rst.Fields(0).Value & vbCrLf & vbCrLf
1809 'call the stored procedure
1810 CallSP_IN_PARAMS con
1811 txtSPResult.Text = txtSPResult.Text & _
1812 "SAMPLE Stored Procedure IN_PARAMS was called." & vbCrLf & vbCrLf
1814 'get information after calling the stored procedure
1815 Set rst = ExecuteSQLCommand(strSQL, strMsgText, con)
1816 txtSPResult.Text = txtSPResult.Text & _
1817 "After calling IN_PARAMS, " & vbCrLf & _
1818 "Sum of salaries for dept. E11 = " & _
1819 rst.Fields(0).Value & vbCrLf
1824 'This procedure calls CallSP_INOUT_PARAM in the module spCall by
1825 'using a parameter got form calling CallSP_OUT_PARAM and outputs
1827 Private Sub CallInOutParameter()
1829 Dim dblMedian As Double
1831 'get a parameter from OUT_PARAM
1832 txtSPResult.Text = "Call OUT_PARAM to get the median."
1833 dblMedian = CallSP_OUT_PARAM(con)
1834 txtSPResult.Text = txtSPResult.Text & vbCrLf & _
1835 "Stored procedure returned successfully." & vbCrLf
1837 'call the stored procedure with the parameter
1838 txtSPResult.Text = txtSPResult.Text & vbCrLf & _
1839 "Call INOUT_PARAM with the result just got."
1840 txtSPResult.Text = txtSPResult.Text & vbCrLf & _
1841 "New median returned from INOUT_PARAM = " & _
1842 CallSP_INOUT_PARAM(con, dblMedian)
1845 'This procedure calls CallSP_ALL_DATA_TYPES in the module spCall
1846 'and displays the results
1847 Private Sub CallAllDataTypes()
1848 'initialize object and settings
1849 Dim pms As ADODB.Parameters
1852 'call the stored procedure
1853 .Text = "Call ALL_DATA_TYPES to get all types of data."
1854 Set pms = CallSP_ALL_DATA_TYPES(con)
1855 .Text = .Text & vbCrLf & "Stored procedure returned successfully."
1858 .Text = .Text & vbCrLf & _
1859 vbCrLf & "Value of SMALLINT = " & pms("SMALL").Value & _
1860 vbCrLf & "Value of INTEGER = " & pms("INTIN").Value & _
1861 vbCrLf & "Value of BIGINT = " & pms("BIGIN").Value & _
1862 vbCrLf & "Value of REAL = " & pms("REALIN").Value & _
1863 vbCrLf & "Value of DOUBLE = " & pms("DOUBLEIN").Value & _
1864 vbCrLf & "Value of CHAR(1) = " & pms("CHAROUT").Value & _
1865 vbCrLf & "Value of CHAR(15) = " & pms("CHARSOUT").Value & _
1866 vbCrLf & "Value of VARCHAR(12) = " & pms("VARCHAROUT").Value & _
1867 vbCrLf & "Value of DATE = " & pms("DATEOUT").Value & _
1868 vbCrLf & "Value of TIME = " & TimeValue(pms("TIMEOUT").Value)
1870 'reset and release the object
1875 'This procedure calls CallSP_DBINFO_EXAMPLE in the module spCall
1876 'with a JOB as an IN parameter and displays the results obtained
1877 'from the stored procedure containing information of the table and
1879 Private Sub CallDbInfo()
1880 'define objects and variables
1881 Dim pms As ADODB.Parameters
1882 Dim strJob As String
1884 'call the stored procedure
1885 txtSPResult.Text = "CALL stored procedure named DBINFO_EXAMPLE."
1887 Set pms = CallSP_DBINFO_EXAMPLE(con, strJob)
1889 'display the results
1890 txtSPResult.Text = txtSPResult.Text & vbCrLf & _
1891 "Stored procedure returned successfully with SQLCODE = " & _
1892 pms("ERRORCODE").Value
1893 txtSPResult.Text = txtSPResult.Text & vbCrLf & _
1894 "Average salary for job " & strJob & " = " & pms("SALARY").Value
1895 txtSPResult.Text = txtSPResult.Text & vbCrLf & _
1896 "Database name from OUT parameter = " & Trim$(pms("DBNAME").Value)
1897 txtSPResult.Text = txtSPResult.Text & vbCrLf & _
1898 "Database version from OUT parameter = " & pms("DBVERSION").Value
1902 'This procedure calls various subroutines in the module udUse to
1903 'execute corresponding user defined functions and displays the
1904 'results onto the screen.
1905 Private Sub cmdUDFs_Click(Index As Integer)
1906 'define the error handler
1907 On Error GoTo cmdUDFs_Error
1909 'clear the screen for result display
1910 sbrStatus.Panels(1).Text = ""
1912 hflxGridUDF.ClearStructure
1914 'call the specific UDF procedure
1915 Select Case cmdUDFs(Index).Caption
1917 hflxGridUDF.ColWidth(3) = 2000
1918 Set hflxGridUDF.DataSource = CallUDFScalarUDF(strMsgText, con)
1919 Case "ClobScalarUDF"
1920 Set hflxGridUDF.DataSource = CallUDFClobScalarUDF(strMsgText, con)
1921 Case "ScratchpadScUDF"
1922 Set hflxGridUDF.DataSource = CallUDFScratchpadScUDF(strMsgText, con)
1923 Case "ScUDFReturningErr"
1924 Set hflxGridUDF.DataSource = CallUDFScUDFReturningErr(strMsgText, con)
1925 txtUDF.Text = strMsgText
1926 Err.Raise vbObjectError, , "See display area for detail."
1927 Case "SourcedColumnUDF"
1928 Set hflxGridUDF.DataSource = CallUDFSourcedColUDF(strMsgText, con)
1930 Set hflxGridUDF.DataSource = CallUDFTableUDF(strMsgText, con)
1933 txtUDF.Text = strMsgText
1935 'generate a message of success
1936 sbrStatus.Panels(1).Text = _
1937 "Calling UDF " & cmdUDFs(Index).Caption & " was done."
1943 'generate an error message and exit
1944 sbrStatus.Panels(1).Text = "ERROR: " & Err.Description
1948 'This procedure defines initial parameters.
1949 Private Sub Form_Load()
1951 wShowInstructions = vbYes
1953 'ask the user for displaying the instructions or not
1954 wShowInstructions = MsgBox("Would you like to have instructions?", _
1955 vbYesNo, "Welcome to the DB2 Visual Basic samples")
1958 'This procedure shows instructions at the begining of the program.
1959 Private Sub Form_Activate()
1960 If wShowInstructions = vbYes Then
1962 "Thank you for using instructions in this demonstration program!" & vbCr & vbCr & _
1963 "- Status messages are shown at the bottom of the working window;" & vbCr & _
1964 "- Buttons unavailable are being grayed out;" & vbCr & _
1965 "- SAMPLE database must be created if it doesn't exist;" & vbCr & _
1966 "- [Exit] button can be pressed at anytime to quit the program." & vbCr & vbCr & _
1967 "You may now choose one of the connections to begin the demonstraton.", _
1968 vbOKOnly, "Instruction"
1972 'This procedure maintains screen integrity for the Main Tabs.
1973 Private Sub tabMain_Click(intPreviousTab As Integer)
1974 'clear the the Tab screen before switching
1975 Select Case tabMain.TabCaption(intPreviousTab)
1977 chkAutoCommit.Value = 1
1979 Set DataGridSQL.DataSource = Nothing
1980 DataGridSQL.ClearFields
1981 Case "Hierarchical Data"
1982 Set hflxRecords.DataSource = Nothing
1987 txtLastname.Text = ""
1988 txtFirstname.Text = ""
1989 AdodcLob.Caption = ""
1990 AdodcLob.Enabled = False
1991 cmdBLOB.Enabled = False
1992 cmdCLOB.Enabled = False
1993 picBlob.Visible = False
1994 Case "Store Procedures"
1996 Set DataGridSP.DataSource = Nothing
1997 DataGridSP.Visible = False
1998 DataGridSP.ClearFields
1999 cmdShowSecondRS.Visible = False
2000 txtSPResult.Text = ""
2006 sbrStatus.Panels(1).Text = ""
2009 'This procedure shows instructions for the Main Tabs.
2010 Private Sub tabMain_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
2012 If wShowInstructions = vbYes Then
2013 If con Is Nothing Then 'no connection established
2015 "All funcitonal features require a valid connection.", _
2016 vbOKOnly + vbExclamation, "Instruction"
2018 Select Case tabMain.Caption
2021 "Please type a SQL statement into the text box, or," & vbCr & _
2022 "choose a preset one from the small Sample buttons, then," & vbCr & _
2023 "press one of the [Execute SQL] buttons to get the results." & vbCr & _
2024 "AutoCommit checkbox can be used to change the autocommit mode." & vbCr & vbCr & _
2025 "For more about the connection, command, and recordset objects," & vbCr & _
2026 "see the source code in the apExeSQL.bas module." & vbCr & vbCr & _
2028 "- The sample SQL statements can be edited." & vbCr & _
2029 "- Recordset results may be editable depending on the SQL statement issued.", _
2030 vbOKOnly, "Instruction"
2031 Case "Hierarchical Data"
2032 If InStr(con.Provider, "MSDataShape") Then
2034 "Please press the [Display] button to display hierarchical result.", _
2035 vbOKOnly, "Instruction"
2038 "Hierarchical Data is only available for a" & vbCr & _
2039 "valid connection with DataShape.", _
2040 vbOKOnly + vbExclamation, "Instruction"
2044 "After pressing the [Refresh Data] button;" & vbCr & _
2045 "Use arrow keys to manipulate results;" & vbCr & _
2046 "Press [Show Resume] button to display CLOBs;" & vbCr & _
2047 "Press [Show Picture] button to display BLOBs.", _
2048 vbOKOnly, "Instruction"
2049 Case "Store Procedures"
2051 "Choose an available stored procedure, then," & vbCr & _
2052 "press the [Call] button to get the results." & vbCr & vbCr & _
2053 "Note: To make them available, you first have to create and catalog" & vbCr & _
2054 "the stored procedures in the spserver stored procedure library.", _
2055 vbOKOnly, "Instruction"
2058 "Please choose one of the UDF buttons to show the usage.", _
2059 vbOKOnly, "Instruction"