Please read the thread below: Chuck in our staff has interesting
comments and some workaround coding methodology that may be the answer.
Laure Hansen,
City of Redwood City
Information Technology
www.redwoodcity.org
1017 Middlefield Road
Redwood City, CA 94063
Tel: 650-780-7087
Fax: 650-556-9204
[EMAIL PROTECTED]
-Original Message-
From: IT-Chuck Smith
Sent: Thursday, March 01, 2007 1:27 PM
To: IT-Laure Hansen
Subject: RE: [U2] Uniobjects.net READU Question
The pre dot.net uniobjects did not have exceptions (more accurately, the
pre dot.net VB did not have exceptions) so you had to check the status.
I continued the practice in my dot net app partly out of habit but also
because I read the documentation and saw that the status tests were
still supported. I agree that it looks like there is a bug, but if the
code is robust you won't hit it. You can send my sample in as a
workaround if you want -- it's definitely the way to go.
Chuck
-Original Message-
From: IT-Laure Hansen
Sent: Thursday, March 01, 2007 1:24 PM
To: IT-Chuck Smith
Subject: RE: [U2] Uniobjects.net READU Question
Thanks, I'll try to look into your code further soon. Do you recommend I
send it back to the U2 e-mail group as a workaround? I'll be happy to do
that.
I'm surprised you haven't hit it in your work in the past (unless there
were no records locks in the code you've written in the past?). Seems
that if it is a known bug, it would have surfaced pretty quickly. Maybe
it is linked to a specific version and/or environment?
Laure Hansen,
City of Redwood City
Information Technology
www.redwoodcity.org
1017 Middlefield Road
Redwood City, CA 94063
Tel: 650-780-7087
Fax: 650-556-9204
[EMAIL PROTECTED]
-Original Message-
From: IT-Chuck Smith
Sent: Thursday, March 01, 2007 1:19 PM
To: IT-Laure Hansen
Subject: RE: [U2] Uniobjects.net READU Question
No I didn't know about it. In addition to catching the exception, we
should test the status. This covers the bases. Here is what I mean
from my demo app (the test for UVE_RNF is for a record that doesn't
exist, i.e. Record Not Found):
Try
Form5020.RecordID = ClaimNo.Trim
Form5020.Read()
Select Case Form5020.FileStatus
Case UVE_NOERROR
If Form5020.Record.Extract(30, 0, 0).StringValue
= "" Then
Call EnableFields(True)
Else
txtApprDate.Text =
UniverseConnection.uonetSession.Oconv(Form5020.Record.Extract(30, 0,
0).StringValue, "D4/")
Call EnableFields(False)
End If
txtEmp5020.Text = ClaimNo.Trim
txtInj5020.Text = ClaimNo.Trim
txtAppr5020.Text = ClaimNo.Trim
temp = Form5020.Record.Extract(1, 1,
0).StringValue
Call GetEmployeeData(temp)
txtEmpSsn.Text = temp.Substring(0, 3) + "-" +
temp.Substring(3, 2) _
+ "-" + temp.Substring(5, 4)
temp =
UniverseConnection.uonetSession.Oconv(Form5020.Record.Extract(14, 0,
0).StringValue, "D4/")
dte = Convert.ToDateTime(temp).ToLongDateString
dteInjuryDate.Value = dte
txtAccidentDesc.Text =
Form5020.Record.Extract(10, 0, 0).StringValue
cnt = InjuryCodes.Dcount(1)
For i = 1 To cnt
If Form5020.Record.Extract(58, 0,
0).StringValue = InjuryCodes.Extract(1, i, 0).StringValue Then
cmbKindOfAccident.SelectedIndex = i - 1
Exit For
End If
Next
txtSupvName.Text = Form5020.Record.Extract(28,
0, 0).StringValue
temp =
UniverseConnection.uonetSession.Oconv(Form5020.Record.Extract(30, 0,
0).StringValue, "D4/")
If temp.Trim <> "" Then
dte =
Convert.ToDateTime(temp).ToLongDateString
txtApprDate.Text = dte.ToString
End If
If txtApprDate.Text <> "" Then
btnApprove.Enabled = False
End If
tab5020.SelectedTab = EmployeeTab
Case UVE_RNF
ok = MessageBox.Show("Claim " + ClaimNo.Trim + "
Not Found.", _
"Simple 5020", buttonType, icontype, 0, 0)
Exit Sub
Case UVE_LCK Or UniObjectsTokens.LOCK_OTHER_READU