فاصله زمانی بین 2 زمان مختلف در یک روز با VB6

''''''''''''''''''''''''''''''''''''
'            00:00:00              '
''''''''''''''''''''''''''''''''''''
Private Sub Command1_Click()
Dim h1, m1, s1 As String
Dim time1 As Long
h1 = Mid(Text1.Text, 1, 2)
m1 = Mid(Text1.Text, 4, 2)
s1 = Mid(Text1.Text, 7, 2)
time1 = (Val(h1) * 60 * 60) + (Val(m1) * 60) + Val(s1)
'''''''''''''''''''''''''''''''''''''
Dim h2, m2, s2 As String
Dim time2 As Long
h2 = Mid(Text2.Text, 1, 2)
m2 = Mid(Text2.Text, 4, 2)
s2 = Mid(Text2.Text, 7, 2)
time2 = (Val(h2) * 60 * 60) + (Val(m2) * 60) + Val(s2)
''''''''''''''''''''''''''''''''''''''
Dim h3, m3, s3 As Integer
Dim newtime As Long
newtime = time2 - time1
h3 = Int(newtime / 3600)
m3 = Int((newtime Mod 3600) / 60)
s3 = Int(((newtime Mod 3600) Mod 60))
''''''''''''''''''''''''''''''''''''''
Text3 = Str(h3) + ":" + Str(m3) + ":" + Str(s3)
'''''''''''''''''''''''''''''''''''''

کار با رجیستری در VB6

Private Sub Command1_Click()
Call SaveSetting("name", "Setting", "value", Text1.Text)
Call SaveSetting("family", "Setting", "value", Text2.Text)
End Sub

Private Sub Command2_Click()
Call DeleteSetting("family")
Call DeleteSetting("name")
End Sub

Private Sub Form_Load()
Dim n, f As String
n = GetSetting("name", "Setting", "value", "nothing")
f = GetSetting("family", "Setting", "value", "nothing")
If n = "nothing" And f = "nothing" Then
MsgBox ("مشخصات شما در سيستم ثبت نيست لطفاً وارد نماييد")
Else
Label1.Caption = n + " " + f
End If
End Sub

کد اتصال به بانک اکسس در VB6

Private Sub Command2_Click()
  
  '           Save Record             '
    cn.Open (constr)
    rs.Open "select * from num", cn, adOpenDynamic, adLockOptimistic
    rs.AddNew
    rs.Fields("name") = Text2.Text
    rs.Fields("family") = Text3.Text
    rs.Fields("num") = Val(Text4.Text)
    rs.Update
    rs.Close
    cn.Close
End Sub

'           Create text file       '

Private Sub Command3_Click()
   Set textFile = fs.OpenTextFile("c:\table.txt", ForWriting, True)
   textFile.WriteLine (Text1.Text)
   textFile.Close
End Sub

Private Sub Command4_Click()

'    save search in text file    '

Set textFile = fs.OpenTextFile("c:\table.txt", ForWriting, True)
cn.Open (constr)
rs.Open "select * from num where num >" & Val(Text1.Text), cn
Do While Not rs.EOF
textFile.WriteLine (rs("num"))
rs.MoveNext
Loop
rs.Close
cn.Close
textFile.Close
End Sub

Private Sub Form_Load()

'          Connection              '

constr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\table.mdb"
End Sub