Board index » delphi » Silly SQL/DB question

Silly SQL/DB question

Hi

How do I transfer a field from a DBGrid to an appropriate variable?

There *must* be a way of doing this but I can't for the life of me
figure it out.

Thanks

Martin Brooks

 

Re:Silly SQL/DB question


Quote
Martin Brooks (mbro...@no.spam.tjguk.com) wrote:

: How do I transfer a field from a DBGrid to an appropriate variable?

: There *must* be a way of doing this but I can't for the life of me
: figure it out.

Do you mean like:

s := MyTable.FieldByName('fldname').AsString;

There's also an asFloat and an asBool (or asBoolean, can't recall
which).

Does that get you started?
--
============================================================
Rick Carter   carte...@email.uc.edu   rcar...@tso.cin.ix.net
============================================================

Re:Silly SQL/DB question


It does indeed. Thankyou very much.

Martin Brooks

Quote
Richard Carter wrote:
> Martin Brooks (mbro...@no.spam.tjguk.com) wrote:
> : How do I transfer a field from a DBGrid to an appropriate variable?

> : There *must* be a way of doing this but I can't for the life of me
> : figure it out.

> Do you mean like:

> s := MyTable.FieldByName('fldname').AsString;

> There's also an asFloat and an asBool (or asBoolean, can't recall
> which).

> Does that get you started?
> --
> ============================================================
> Rick Carter   carte...@email.uc.edu   rcar...@tso.cin.ix.net
> ============================================================

Re:Silly SQL/DB question


In article <360A58F4.7A548...@dial.pipex.com>, Andrew Burns

Quote
<mak...@dial.pipex.com> writes:
>The problem I have is that I don't seem to be able to copy the
>information from memory to the file correctly - eg. the RIFF identifier
>(just 4 bytes - one for each letter) ends up with another byte infront
>of it.

Have you specified TMyHeaderType = packed record etc etc. The packed specifies
"no alignment on DWord boundaries" - hence no inserted extra bytes..

Note that in D2 the entry under Packed (in Delphi help) is incorrect, the entry
under Structured Types is correct in its description of packed.

File structures for wave files are fully specified at www.wotsit. (I'm not sure
after this .co.uk or .com. Search for wotsit.)

BTW I don't think alt.comp.borland-delphi exists any more - take it off your
list. Its particularly awkward for AOL users who are constrained to reply only
to the first NG in the list, unless they do laborious copy and paste.

Alan Lloyd
alangll...@aol.com

Re:Silly SQL/DB question


AlanGLLoyd wrote ...

Quote
>File structures for wave files are fully specified at www.wotsit. (I'm not
sure
>after this .co.uk or .com. Search for wotsit.)

http://www.wotsit.org/

Try this!

Andy Jeffries
Kwik-Rite Development

Other Threads