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
This function uses a select statment to populate controls on a form
'****************************************************************** '* Value(s)passed: ..... '* Value(s)returned: ..... '* Date: 10-12-2002 '* Author: Ahmad E. Ashparie '* ___________________________________________ '* Modification Log '* Date Author Description '* ------ -------- ------------- '* '******************************************************************* Public Function ReadPersonTable(selectedItem As String) As Boolean Dim Resultset As rdoResultset Dim strSql As String Dim tableName Dim NoOfRecords As Long Dim SelectedSSN 'get person ssnid SelectedSSN = GetPersonID(selectedItem) 'set SQL string strSql = "select * from tb_db_person where person_id = " _ & (SelectedSSN) & "" 'set resultset to populate person info Set Resultset = myDB.OpenResultset _ (strSql, rdOpenForwardOnly, rdConcurReadOnly) 'check if record exists If Resultset.EOF Then 'if not display msg, close resutlset and exit MsgBox "Details for selected record is not available ...!", vbCritical Resultset.Close Set Resultset = Nothing ReadPersonTable = False Exit Function Else 'if record exists,populate controls With Resultset frmSearchUsers_tb.ProgressBar1.Value = 20 frmSearchUsers_tb.txtPersonId.Text = Trim(SelectedSSN) & "" frmSearchUsers_tb.txtLastName.Text = Trim(!prsn_Last_Name) & "" frmSearchUsers_tb.txtFirstName.Text = Trim(!prsn_first_name) & "" frmSearchUsers_tb.txtMI.Text = Trim(!prsn_mi) & "" frmSearchUsers_tb.MskSSN.Mask = "" frmSearchUsers_tb.MskSSN.Text = (!prsn_ssn) & "" frmSearchUsers_tb.txtAge.Text = Trim(!prsn_age) & "" End With 'close resultset Resultset.Close Set Resultset = Nothing End If End Function
-
HOME
|
ABOUT
|
CONTACT US
Copyright © 2009 ASP-VBCode