Article View: be.comp.programming
Article #4041HOWTO: use RowSource property of a field in MS Access table
From: Vladimir
Date: Mon, 15 Sep 2003 19:33
Date: Mon, 15 Sep 2003 19:33
21 lines
2349 bytes
2349 bytes
Hello,
I have a table in MS Access database. It has one field (with BYTE datatype)
that has several properties set in Lookup tab of table Design View.
Display Control = Combo Box. Row Source Type = Value List. 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? The code is below:
CString tmp;
_RecordsetPtr pRs("ADODB.Recordset");
tmp = "select field from table"; // query
pRs->Open((_bstr_t)tmp, _variant_t((IDispatch*)pGWMConn, true),
adOpenForwardOnly, adLockReadOnly, adCmdText); // open recordset
tmp = (LPCTSTR)(_bstr_t)pRs->Fields->Item["field"]->Value; // get
numeric value (string from Row Source is needed)
pRs->Close();
Regards,
Vladimir.
Technical Details
Message-ID:
<1063654572.733837@ufacom.ru>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!uio.no!195.54.106.170.MISMATCH!newsfeed1!bredband!newsfeed.sovam.com!sovam!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: ff0ac,5c969b162d5156fa,start X-Google-Attributes: gidff0ac,public X-Google-Thread: fcea4,5c969b162d5156fa,start X-Google-Attributes: gidfcea4,public X-Google-Thread: 113dfb,5c969b162d5156fa,start X-Google-Attributes: gid113dfb,public X-Google-Thread: 108717,5c969b162d5156fa,start X-Google-Attributes: gid108717,public X-Google-ArrivalTime: 2003-09-15 12:50:07 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!uio.no!195.54.106.170.MISMATCH!newsfeed1!bredband!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: HOWTO: use RowSource property of a field in MS Access table Date: Tue, 16 Sep 2003 01:33:48 +0600 Organization: Ufa GTS Lines: 25 Message-ID: <1063654572.733837@ufacom.ru> NNTP-Posting-Host: 195.239.153.9 X-Trace: news.rol.ru 1063654573 9325 195.239.153.9 (15 Sep 2003 19:36:13 GMT) X-Complaints-To: abuse@online.ru NNTP-Posting-Date: Mon, 15 Sep 2003 19:36:13 +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@g137-164-133-62.ufacom.ru X-Cache: nntpcache 2.3.3 (see http://www.nntpcache.org/)