torturedmind
Programmer
i have a form that has 3 data controls:
data1 - log file; opened for writing (table)
data2 - look-up file #1; read-only (dynaset)
data3 - look-up file #2; read-only (dynaset)
all data controls are linked to their respective
foxpro 2.6 table.
my app actually reads an i.d. no. via the keyboard,
look it up from the master file, test the plugged
wrist strap, and look-up the return value from another
table.
i am also using a DLL file which i downloaded from the web
and this allows my app to read from LPT1. i am also using
a timer control (Timer3) to have a delay time between ID
No. entry and the actual wrist strap testing.
here are some parts of my codes from the form:
*********************************************************
Private Sub cmbidnum_Validate(Cancel As Boolean)
Dim xfind As String
Dim xmsg As String
xfind = "idnumb = '" & Trim(cmbidnum) & "'"
Data2.Recordset.FindFirst xfind
If Data2.Recordset.NoMatch Then
xmsg = MsgBox("Record not found.", vbExclamation)
Cancel = True
Else
xidnum = Data2.Recordset.Fields("idnumb"
xempname = Data2.Recordset.Fields("name"
Timer3.Enabled = True
Cancel = False
End If
End Sub
Private Sub Timer3_Timer()
Dim xfind2 As String
xtestvalue = Inport(stat_reg)
t_val = xtestvalue
xt_val = t_val
xfind2 = "esdval = " & t_val
Data3.Recordset.FindFirst xfind2
If Data3.Recordset.NoMatch Then
Data3.Recordset.MoveFirst ' This is where the <unknown error> is.
End If
xstat = Data3.Recordset.Fields("esddesc"
Data1.Recordset.AddNew
Data1.Recordset.Fields("idnum"
= Trim(xidnum)
Data1.Recordset.Fields("empname"
= Trim(xempname)
Data1.Recordset.Fields("petsa"
= xpetsa
Data1.Recordset.Fields("oras"
= Trim(xoras)
Data1.Recordset.Fields("esd_stat"
= Trim(xstat)
Data1.Recordset.Fields("testvalue"
= xtestvalue
Data1.Recordset.Update
End sub
*********************************************************
Now my PROBLEM is some ID No. generates a "Runtime error
3043. Disk or network error." but most do not. When i view
the log file from VFP6, every entry were recorded except
that the records that generated the error are deleted. I
know there is something wrong with my code coz honestly am
a newbie in VB6. Can anyone please help before I lose my
sanity?
torturedmind [Trooper]
data1 - log file; opened for writing (table)
data2 - look-up file #1; read-only (dynaset)
data3 - look-up file #2; read-only (dynaset)
all data controls are linked to their respective
foxpro 2.6 table.
my app actually reads an i.d. no. via the keyboard,
look it up from the master file, test the plugged
wrist strap, and look-up the return value from another
table.
i am also using a DLL file which i downloaded from the web
and this allows my app to read from LPT1. i am also using
a timer control (Timer3) to have a delay time between ID
No. entry and the actual wrist strap testing.
here are some parts of my codes from the form:
*********************************************************
Private Sub cmbidnum_Validate(Cancel As Boolean)
Dim xfind As String
Dim xmsg As String
xfind = "idnumb = '" & Trim(cmbidnum) & "'"
Data2.Recordset.FindFirst xfind
If Data2.Recordset.NoMatch Then
xmsg = MsgBox("Record not found.", vbExclamation)
Cancel = True
Else
xidnum = Data2.Recordset.Fields("idnumb"
xempname = Data2.Recordset.Fields("name"
Timer3.Enabled = True
Cancel = False
End If
End Sub
Private Sub Timer3_Timer()
Dim xfind2 As String
xtestvalue = Inport(stat_reg)
t_val = xtestvalue
xt_val = t_val
xfind2 = "esdval = " & t_val
Data3.Recordset.FindFirst xfind2
If Data3.Recordset.NoMatch Then
Data3.Recordset.MoveFirst ' This is where the <unknown error> is.
End If
xstat = Data3.Recordset.Fields("esddesc"
Data1.Recordset.AddNew
Data1.Recordset.Fields("idnum"
Data1.Recordset.Fields("empname"
Data1.Recordset.Fields("petsa"
Data1.Recordset.Fields("oras"
Data1.Recordset.Fields("esd_stat"
Data1.Recordset.Fields("testvalue"
Data1.Recordset.Update
End sub
*********************************************************
Now my PROBLEM is some ID No. generates a "Runtime error
3043. Disk or network error." but most do not. When i view
the log file from VFP6, every entry were recorded except
that the records that generated the error are deleted. I
know there is something wrong with my code coz honestly am
a newbie in VB6. Can anyone please help before I lose my
sanity?
torturedmind [Trooper]