Thread View: comp.lang.basic.visual.database
2 messages
2 total messages
Started by Adam Moroff
Mon, 06 Mar 2000 00:00
ListView - Invalid Key Problem - HELP!
Author: 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
Re: ListView - Invalid Key Problem - HELP!
Author: Jesper H�jgaard
Date: Tue, 07 Mar 2000 00:00
Date: Tue, 07 Mar 2000 00:00
14 lines
1320 bytes
1320 bytes
You can't use a number as a key, but you can use ID & "ID" as key. Regards. Jesper H�jgaard Deloitte & Touche - Denmark > 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?? [SNIP...] > any help would be appreciated > Adam
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads