Re: Basics
- From: "Andrei \"Ndi\" Dobrin" <nospam@xxxxxxxxxx>
- Date: Wed, 23 Jul 2008 12:25:00 +0300
To access the value in a field in the current record use:
ADODataSet1.FieldByName('TheField').AsString;
There are also AsInteger, AsFloat etc. for the other datatypes. See the
on-line help for details.
I got that far yesterday trying my luck around but that only works if I get
a single record in return. If I execute a query that returns -say- 5 rows,
how doI get the phone number for each one without using a DBGrid or one of
those navigator things and telling it to advance?
Also, I don't get anything for blobs. AsString always returns ''. I'm
digging as we speak.
I have no idea what is causing your EOutOfMemory exeception. If you
want help with that you need to provide a much more detailed
explanation of what you are doing and what code causes the exception
and that includes the full text of the error message.
I get me a TADOConnection, an ADO data set and a vanilla data source, set
the connection settings to link to a postgresql 8.2, then issue a select
along the lines of "select pic from pictures where picid='00089'". That
returns one row, one column, as expected, with pic being a (blob). That
yields an "Out of Memory" exception that the application pops. Unsetting the
DBGrid's source property (effectively disabling the link), I get no such
error. My guess is the driver tries to pass the blob to the grid and it's a
bit too largeto chew - though I know the blob is a 400x300 jpg that is hex
encoded so it's well under 50K or so as a general rule. Even ununcoded RGB
that is hex translated is like 900K for an image that size.
All other tools have no issue showing the blob - e.g. PGAdmin shows
"FFFED5...". I assume it retrieves the blob separately and converts to
string bu that kinda defeats the purpose of having a DBGrid in the first
place doesn't it?
Don't get hung on this though, I have no intentions of using DBGrids to
retrieve pics. I just thought it's silly to get an error in a perfectly
legit select.
--
Bill Todd (TeamB)
Thank you,
--
Andrei "Ndi" Dobrin
www.Ndi.ro
Brinbench MVP
www.Brainbench.com
IT/Infrastructure Dept, IDM Kennedy Group
www.IDM.ro
.
- Follow-Ups:
- Re: Basics
- From: yannis
- Re: Basics
- References:
- Basics
- From: Andrei \"Ndi\" Dobrin
- Re: Basics
- From: Bill Todd [TeamB]
- Basics
- Prev by Date: Really slow access to TADODataSet
- Next by Date: Re: Basics
- Previous by thread: Re: Basics
- Next by thread: Re: Basics
- Index(es):