🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.database.ado
Article #779

Re: Records to the Combobox?

#779
From: Daryl
Date: Tue, 12 Apr 2005 21:10
36 lines
1986 bytes
Daryl wrote:
> James Peterson wrote:
> 
>> ComboBox1->BeginUpdate();
>> ComboBox1->Items->Add(ADOQuery1->Fields->Fields[0]->Value );
>> ComboBox1->EndUpdate();
>>
>> this should work.
>>
>> "Guest" <Guest@aew_nospam.com> wrote in message
>> news:41863815$1@newsgroups.borland.com...
>>
>>> Hi,
>>>
>>> This line adds only one row in combobox:
>>> ComboBox1->Items->Add(ADOQuery1->Fields->Fields[0]->Value );
>>>
>>> How can add all records to the combobox?
>>>
>>> User submitted from AEWNET (http://www.aewnet.com/)
>>
>>
>>
>>
> You may have to loop through the recordset generated by the ADOQuery
> Example
> 
> int pos = 0;
> While (!ADOQuery1->Eof) {
>   ComboBox1->Items->Add(ADOQuery1->Fields->Fields[0]->Value );
>   pos++;
>   ADOQuery1->Next();
> }
Sorry
  ComboBox1->Items->Add(ADOQuery1->Fields->Fields[0]->Value );  should be
  ComboBox1->Items->Add(ADOQuery1->Fields->Fields[pos]->Value );
Technical Details
Message-ID: <425c39a4$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news2.google.com!newsread.com!newsprint.newsread.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <41863815$1@newsgroups.borland.com> <4256b3d7$1@newsgroups.borland.com> <425c391d$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,17ab27b9c4e85127
X-Google-Attributes: gid10698b,public
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Wed, 13 Apr 2005 07:10:15 +1000
From: Daryl <developeracc@hotmail.com>
User-Agent: Mozilla Thunderbird 0.9 (Windows/20041103)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.database.ado
Subject: Re: Records to the Combobox?
References: <41863815$1@newsgroups.borland.com> <4256b3d7$1@newsgroups.borland.com> <425c391d$1@newsgroups.borland.com>
In-Reply-To: <425c391d$1@newsgroups.borland.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 203.103.112.241
Message-ID: <425c39a4$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1113340324 203.103.112.241 (12 Apr 2005 14:12:04 -0800)
Lines: 36
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news2.google.com!newsread.com!newsprint.newsread.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail