Visual Basic 6 Code
Functions/Procedures
InQuotes Function
PauseTime Proc.
Remove Invld Chr Function
Database Insert Proc.
Database Select Function
Database Delete Proc.
Database Update Function
Make Enter key to act as TAB
Time calculation
Change 1st char to Ucase
Populate MSFlxGrid with db data
How to use CASE
Save file
Open file
Populate TreeView w/database
Catch RDO Error
Populate MSFlxGrid with data from database
'****************************************************************** '* Value(s)passed: ..... '* Value(s)returned: ..... '* Date: 10-12-2002 '* Author: Ahmad E. Ashparie '* ___________________________________________ '* Modification Log '* Date Author Description '* ------ -------- ------------- '* '******************************************************************* Private Sub PopulateProcGrid() Dim grdResultset As rdoResultset Dim strSqlGrd As String Dim NoOfRecords As Long Dim CountOfRecords As Long NoOfRecords = 1 'Me.Show DoEvents MSHFlexGrid1.Clear ' With MSHFlexGrid1 .ColWidth(0) = 400 .TextMatrix(.FixedRows - 1, 0) = "ID" .ColWidth(1) = 1500 .TextMatrix(.FixedRows - 1, 1) = "Code1" .ColWidth(2) = 5000 .TextMatrix(.FixedRows - 1, 2) = "Procedure Name" .ColWidth(3) = 1200 .TextMatrix(.FixedRows - 1, 3) = "Service Type" .ColWidth(4) = 1100 .TextMatrix(.FixedRows - 1, 4) = "Code2" End With Screen.MousePointer = vbHourglass Load frmAnm 'frmAnm.Move 4000, 3000 frmAnm.Show strSqlGrd = "select * from tb_procedure where Val_active=1" Set grdResultset = MyDB.OpenResultset _ (strSqlGrd, rdOpenKeyset, rdConcurReadOnly) If grdResultset.EOF Then 'do nothing Else Do Until grdResultset.EOF CountOfRecords = CountOfRecords + 1 grdResultset.MoveNext Loop grdResultset.MoveFirst End If frmAnm.ProgressBar1.Max = CountOfRecords With grdResultset If .EOF And .BOF Then Screen.MousePointer = vbDefault grdResultset.Close Set grdResultset = Nothing DoEvents Else Do Until .EOF MSHFlexGrid1.Rows = NoOfRecords + 1 MSHFlexGrid1.TextMatrix(NoOfRecords, 0) = Trim(!procedure_id) MSHFlexGrid1.TextMatrix(NoOfRecords, 1) = Trim(ChkValue(!procedure_code)) & "" MSHFlexGrid1.TextMatrix(NoOfRecords, 2) = Trim(ChkValue(!procedure_name)) & "" MSHFlexGrid1.TextMatrix(NoOfRecords, 3) = Trim(ChkValue(!service_type)) & "" MSHFlexGrid1.TextMatrix(NoOfRecords, 4) = Trim(ChkValue(!cpt4_code)) & "" frmAnm.ProgressBar1.Value = NoOfRecords .MoveNext frmAnm.Label3 = NoOfRecords DoEvents NoOfRecords = NoOfRecords + 1 DoEvents Loop End If End With Screen.MousePointer = vbDefault grdResultset.Close Set grdResultset = Nothing frmAnm.Label2.Caption = "Completed ..." DoEvents PauseTime 1 frmAnm.WindowState = vbMinimized Unload frmAnm End Sub
-
HOME
|
ABOUT
|
CONTACT US
Copyright © 2009 ASP-VBCode