I am using the list view control (mscomctl.ocx) in my application. While populating the items in the listview (lvResCat) I am setting the keys of the items as "R" and then suffixing the ID of the record fetched from the database table. See the code below: Table has fields: ID, Code, Description
lIndex = 1
Do While Not rsData.EOF
sTemp = "R" & rsData!id
lvResCat.ListItems.Add lIndex, sTemp, Trim(rsData!code)
lIndex = lIndex + 1
I know the code is fine and infact it works on all machines. But to my surprise it gave errors on some machines (laptops) with XP and windows 2003 server. I have tried every possible combinations like settng the keys differently etc. The version of the mscomctl.ocx used is 18.104.22.168 and is the same on these machines too.
As just the exe file, or packaged using an installer?
"Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
"I have my standards. They may be low, but I have them!" - Bette Middler
"It's a book about a Spanish guy named Manual. You should read it." - Dilbert
Anyway...the error comes using the exe as well as using the installer. I found another interesting thing yesterday that the error (sometimes, not always) actually gets generated after populating one item in the list. If we use the key as a complete varchar then it works fine. The key is not acepting any numbers in it.