D
Dymondjack
Hello and thanks in advance for any input
I've recently been having some issues with recordsets and their sort order.
I am running access03 on an XP system, and everything has been working fine
for the past three months (since I set it up for my company). At my house,
where I do most of the developing, I upgraded from XP to Vista over the
weekend. Since I have taken a development copy home for modifications, I
have been getting strange recordset orders/results while testing on the XP
system. For example:
systblProgram is a table that gets used to temporarily store text files that
are sorted by line. .Fields(0) = intLine and .Fields(1) = strContent
In the past, I have been able to input this data directly to the table and
later open the table directly (db.OpenRecordset("systblProgram")) and have
the records ordered by .Fields(0). This one wasn't too big of a problem, I
just based the recordset off an ordered query rather than the table directly.
Now, here's another issue I've found. I've got tblPrograms whose primary
key is a string based off a number (10001-00, 10002-00, 10003-00 ect...).
Now, when I run the following code, the cursor does not move to the last
record as specified, but rather the record before that. (The last record has
a key of 10124-00, but rsPrograms.MoveLast returns 10123-00). This
particular function has ran flawlessly for the last 124 program inputs, and
after being exposed to a Vista OS I am having trouble with it.
Has anyone experianced any sort of issues like this? Any input on this
would be a great help. Here's the core of the code for the pvtNextNumber
function
CODESTART*****
Set rsPrograms = db.OpenRecordset("tblPrograms")
blnRSProgramsOpen = True
'Check for Records
If rsPrograms.RecordCount <> 0 Then
rsPrograms.MoveLast
strLastProgram = rsPrograms.Fields(0) 'This line returns LastRec-1
strLastProgram = Mid(strLastProgram, 1, 5)
intLastProgram = CInt(strLastProgram)
intLastProgram = intLastProgram + 1
strLastProgram = Trim(Str(intLastProgram)) & "-00"
pvtstrProgram = strLastProgram
'If NoRecords
Else
pvtstrProgram = "10000-00"
End If
CODEEND*****
Any help greatly appreciated
Thanks
Jack
I've recently been having some issues with recordsets and their sort order.
I am running access03 on an XP system, and everything has been working fine
for the past three months (since I set it up for my company). At my house,
where I do most of the developing, I upgraded from XP to Vista over the
weekend. Since I have taken a development copy home for modifications, I
have been getting strange recordset orders/results while testing on the XP
system. For example:
systblProgram is a table that gets used to temporarily store text files that
are sorted by line. .Fields(0) = intLine and .Fields(1) = strContent
In the past, I have been able to input this data directly to the table and
later open the table directly (db.OpenRecordset("systblProgram")) and have
the records ordered by .Fields(0). This one wasn't too big of a problem, I
just based the recordset off an ordered query rather than the table directly.
Now, here's another issue I've found. I've got tblPrograms whose primary
key is a string based off a number (10001-00, 10002-00, 10003-00 ect...).
Now, when I run the following code, the cursor does not move to the last
record as specified, but rather the record before that. (The last record has
a key of 10124-00, but rsPrograms.MoveLast returns 10123-00). This
particular function has ran flawlessly for the last 124 program inputs, and
after being exposed to a Vista OS I am having trouble with it.
Has anyone experianced any sort of issues like this? Any input on this
would be a great help. Here's the core of the code for the pvtNextNumber
function
CODESTART*****
Set rsPrograms = db.OpenRecordset("tblPrograms")
blnRSProgramsOpen = True
'Check for Records
If rsPrograms.RecordCount <> 0 Then
rsPrograms.MoveLast
strLastProgram = rsPrograms.Fields(0) 'This line returns LastRec-1
strLastProgram = Mid(strLastProgram, 1, 5)
intLastProgram = CInt(strLastProgram)
intLastProgram = intLastProgram + 1
strLastProgram = Trim(Str(intLastProgram)) & "-00"
pvtstrProgram = strLastProgram
'If NoRecords
Else
pvtstrProgram = "10000-00"
End If
CODEEND*****
Any help greatly appreciated
Thanks
Jack