Article View: borland.public.cppbuilder.database.ado
Article #2054Accessing a Cell of an Access Table directly by code with ADO
From: Alen Markov
Date: Mon, 24 Nov 2003 20:02
Date: Mon, 24 Nov 2003 20:02
66 lines
3164 bytes
3164 bytes
Read my previous post (Answer to Marcel) how I connect to my AccessTable... Just by "hooking" up some components together - simple and quite easy, but not really satisfying... However, I have everything working for my small application so far, here is a picture of it: http://homepage.hispeed.ch/alien/snapshot.jpg Assume I have an Access table called "SOFTWARE" and it holds a few columns: Name (String) CDID (Number) CategoryID (Number) TypeID (String) Keywords (String) Description (Memo) Path (String) Since I connected the DBGrid with the Access table, I can edit the columns Name, CDID, CategoryID, TypeID and Keywords directly in the table, works fine... To the column Description I connected with a DBMemo, so I can edit that one directly too... Now about the column Path: Here I want to store the path to a picture. Means I select a picture with "OpenPictureDialog" and want to save the selected Path to the column, so each row has a Path to a picture if necessary... I tryed it with a DBEdit - I connected that one with the DataField "Path". If I write directly by Hand into that DBEdit and then press the tab-key, the value I entered is directly stored into the mdb-File in the column Path for the appropriate row... First thought was - great, that's it... So I just added this simple code: OpenPictureDialog1->Execute(); DBEdit1->Text = OpenPictureDialog1->FileName; But this doesn't STORE the value (Path) into the mdb-File :-/ (as soon as I click with the mouse into that DBEdit1, the path is gone again...) So if anybody has a minute left to explain how to write a value (in my case the path) directly into the column "Path" of my mdb-File? ...then I could finally finnish my Application to V1.0 The current V0.99 doesn't have support for description and picture yet, and therefore looks simple like this: http://homepage.sunrise.ch/mysunrise/amarkov/swc.html I added now the description (as shown in the snapshot http://homepage.hispeed.ch/alien/snapshot.jpg) and now would just like to finnish that thingy with the path so I can add a picture too... Cheers Alen -- WEB: http://www.come.to/nostromo
Technical Details
Message-ID:
<3fc26387@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10698b,b1bab58e749cc854,start X-Google-Attributes: gid10698b,public X-Google-ArrivalTime: 2003-11-24 12:10:28 PST From: "Alen Markov" <NOSPAM_amarkov@gmx.net> Newsgroups: borland.public.cppbuilder.database.ado Subject: Accessing a Cell of an Access Table directly by code with ADO Date: Mon, 24 Nov 2003 21:02:48 +0100 Lines: 68 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 NNTP-Posting-Host: 217.162.156.2 Message-ID: <3fc26387@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1069704071 217.162.156.2 (24 Nov 2003 12:01:11 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail