Article View: comp.lang.basic.visual.database
Article #38ListView - Invalid Key Problem - HELP!
From: Adam Moroff
Date: Mon, 06 Mar 2000 00:00
Date: Mon, 06 Mar 2000 00:00
28 lines
1697 bytes
1697 bytes
Hi,
I have a table containing 2 columns, the first is an ID column with random
numbers in Long Integer format. The second is a text field containing
peoples names.
I am using a ListView object to display the names, howver the ADD method of
the ListView object wont let me display the names using the ID field as the
KEY, it keeps returning INVALID KEY. Why??
The code is as follows:
'**************************************
'* Wnd is the name of the form
'* LstNames is the name of the ListView Control
'* *************************************
Dim list As ListItem
Set rs = New Recordset
rs.Open "contact", db, adOpenForwardOnly, adLockPessimistic '*open the
contact table*
Do
Set list = Wnd.LstNames.ListItems.Add(, rs("contact_id") ,
rs("key_contact"))
Loop While Not rs.EOF
any help would be appreciated
Adam
Technical Details
Message-ID:
<38c37e52@pink.one.net.au>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 100d42,708d6323dfb6a04d,start X-Google-Attributes: gid100d42,public X-Google-Thread: 111c14,708d6323dfb6a04d,start X-Google-Attributes: gid111c14,public X-Google-Thread: 1143a7,708d6323dfb6a04d,start X-Google-Attributes: gid1143a7,public X-Google-Thread: 108062,708d6323dfb6a04d,start X-Google-Attributes: gid108062,public From: "Adam Moroff" <moroffa@one.net.au> Subject: ListView - Invalid Key Problem - HELP! Date: 2000/03/06 Message-ID: <38c37e52@pink.one.net.au> X-Deja-AN: 593738716 X-Trace: 6 Mar 2000 20:45:54 +1000, 203.101.9.37 X-MSMail-Priority: Normal X-Priority: 3 Newsgroups: comp.lang.basic.visual.database,cz.comp.lang.basic.visual,microsoft.public.basic.other,no.it.programmering.visual-basic X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700