Passing string from DBF field to a variable (Halcyon 4.0) 
Author Message
 Passing string from DBF field to a variable (Halcyon 4.0)

Hi there.

I wonder if there is anybody out there who can help me.
I'm building an app to run from CD-ROM, it has to start an other program,
the other programs path and filename is stored in a DBF file.
How do I pass this information to a variable that I can use.
I'm using Halcyon 4.0 database engine.

I would like some code examples, if it is not asking to much.

Regards, Ole



Wed, 18 Jun 1902 08:00:00 GMT  
 Passing string from DBF field to a variable (Halcyon 4.0)


Quote:
> I wonder if there is anybody out there who can help me.
> I'm building an app to run from CD-ROM, it has to start an other program,
> the other programs path and filename is stored in a DBF file.

I don't think you're going to be able to do this with a dBase database or
any database for that matter.  A CD-ROM is Read Only.  Even if you aren't
updating records, all the database engines I know about need to open the
DB's with read/write access.

Quote:
> How do I pass this information to a variable that I can use.
> I'm using Halcyon 4.0 database engine.

There are three methods for extracting information directly from a TTable
or TQuery.  Either by using the field's object name, or by using
"Fields[x]" (field index) or by using "FieldByName" (as shown below).  If
your result fields are instantiated at design time you can choose either
method.  If you are working with an ad-hoc or temp query where the fields
editor hasn't been used to hard-code the fields into the form's listing of
objects at design time, you can only use "FieldByName" or "Fields[x]".

Quote:
> I would like some code examples, if it is not asking to much.

var
s: string;
begin
s := Query1.FieldByName('field_name').AsString;  (best method available)
end;

or...

var
s: string;
begin
s := Query1.Fields[0].AsString;  (field # index [not a great idea])
end;

or...

var
s:string;
begin
s := Query1FIELD_NAME.AsString;  (hard coded field as "separate" object)
end;

hope this helps!
--
======================================

embedded email address in post is a
moronic spammer
======================================



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Date Field passing to SQL string

2. How Do I copy one field value to a string variable

3. How to read MSDOS variables from TP 4.0

4. Passing Report Variables from the Master to Detail Reports

5. Newbie: Passing a Function Variable

6. Passing a variable to QuickReport

7. Passing variables to Procs

8. passing variable sized arrays to a proc/func

9. PAssing a variable to TP7 through the command line

10. Passing date variable to Report Smith in dd/mm/yy format

11. Passing file variable to Function

12. Variable Passing

 

 
Powered by phpBB® Forum Software