Article View: be.comp.programming
Article #4044Re: HOWTO: use RowSource property of a field in MS Access table
From: Vladimir
Date: Tue, 16 Sep 2003 06:10
Date: Tue, 16 Sep 2003 06:10
49 lines
3627 bytes
3627 bytes
Hello, But why can't I get access to Properties collection of Field object? In Access Help I've read that I can set these (RowSource and others) properties through VB. Why can't I do this in my C++ app? Also when I execute query SELECT <field> FROM <table> in Access Query Designer I get string. When I execute through ADO I get number. The problem is that I don't know if Row Source string array will never be changed. If I place this array in my app I will then need to make changes to source code and re-compile the program. The "Ideal" way is also unacceptable because the users of my app will need to add this new table to the database every time it is replaced by new one (which is without this table). I mean replacing whole MDB files. Regards, Vladimir. Programmer Dude <cjsonnack@mmm.com> ����� � ���������:3F661B99.F254B2B5@mmm.com... > Vladimir wrote: > > > Row Source = "1; "Above"; 2; "Below"; 3; "Equal"". > > When I try to SELECT <field> FROM <table> in my C++ application > > through ADO, I get numeric value of the field. How can I get > > string representation of this numeric value from the Row Source > > property? > > You don't. It doesn't exist in the table, ONLY in the Access Form > (specifically, in the ComboBox). I assume the BoundColumn prop is > set to 1. That means that when a user selects an item from the CB, > the first column's value is put in the database field. The second > column values (the strings) never leave the CB. > > You have two choices: > > Ideal: create a new table containing the CB Row Source values, and > use that to populate the CB. When you open a recordset, open an > SQL query that joins the main table to the new table and select > the field containing the strings. > > Workable: Re-create the Row Source data in your C++ application > and translate from the numeric value to the string. > > -- > |_ CJSonnack <Chris@Sonnack.com> _____________| How's my programming? | > |_ http://www.Sonnack.com/ ___________________| Call: 1-800-DEV-NULL | > |_____________________________________________|_______________________|
Technical Details
Message-ID:
<1063692744.877932@ufacom.ru>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!nntp.cs.ubc.ca!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.sovam.com!sovam!not-for-mailReferences:
<1063654572.733837@ufacom.ru> <3F661B99.F254B2B5@mmm.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: 113dfb,5c969b162d5156fa X-Google-Attributes: gid113dfb,public X-Google-Thread: 108717,5c969b162d5156fa X-Google-Attributes: gid108717,public X-Google-Thread: ff0ac,5c969b162d5156fa X-Google-Attributes: gidff0ac,public X-Google-Thread: fcea4,5c969b162d5156fa X-Google-Attributes: gidfcea4,public X-Google-ArrivalTime: 2003-09-15 23:20:03 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!nntp.cs.ubc.ca!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.sovam.com!sovam!not-for-mail From: "Vladimir" <genisoft@ufacom.ru> Newsgroups: be.comp.programming,comp.databases.ms-access,comp.os.ms-windows.programmer.win32,comp.programming Subject: Re: HOWTO: use RowSource property of a field in MS Access table Date: Tue, 16 Sep 2003 12:10:54 +0600 Organization: Ufa GTS Lines: 51 Message-ID: <1063692744.877932@ufacom.ru> References: <1063654572.733837@ufacom.ru> <3F661B99.F254B2B5@mmm.com> NNTP-Posting-Host: 195.239.153.9 X-Trace: news.rol.ru 1063692745 23209 195.239.153.9 (16 Sep 2003 06:12:25 GMT) X-Complaints-To: abuse@online.ru NNTP-Posting-Date: Tue, 16 Sep 2003 06:12:25 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2615.200 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 Cache-Post-Path: ufacom.ru!unknown@g102-164-133-62.ufacom.ru X-Cache: nntpcache 2.3.3 (see http://www.nntpcache.org/)