Problems passing a field array as argument to InsertRecord 
Author Message
 Problems passing a field array as argument to InsertRecord

I'm using InsertRecord to add a record to my database, but I get an
exception saying that a required field wasn't specified:

"Project Project1.exe raised exception class EDBEngineError with message
'Field value required. Field: Gender'. Process stopped. [etc.].".

The code looks like this:

InsertRecord([123,'Martin Hamann',true,true, true]);

I would like to put the boolean value true into the field Gender in my
database, and according to the Database Desktop the first 5 fields of my
database are long integer, alpha, logical, logical and logical (they are
"customer number","name","gender","whatever","whatever"... so gender is -
according to the Database Desktop - the third field).

Does anybody have an idea what I'm doing wrong ?

Is there any to specify a new value for a specific field ? For example, find
a specific record and change the gender-field of the person ? [perhaps not
the most crucial function to implement, but still.. ;-) ] SetFields seems to
apply to all fields...

I'm using delphi 4 on a Windows 98 based system.

Thanks in advance for any hints :-)
Martin Hamann, student of software engineering,
Technical University of Denmark.
http://www.*-*-*.com/



Fri, 05 Sep 2003 04:59:21 GMT  
 Problems passing a field array as argument to InsertRecord
The field order used by InsertRecord is the order defined by the Fields
property and not by the layout of the actual table. Double-click your
TTable/TQuery component and check if you used predefined field definitions.



Quote:
> I'm using InsertRecord to add a record to my database, but I get an
> exception saying that a required field wasn't specified:

> "Project Project1.exe raised exception class EDBEngineError with message
> 'Field value required. Field: Gender'. Process stopped. [etc.].".

> The code looks like this:

> InsertRecord([123,'Martin Hamann',true,true, true]);

> I would like to put the boolean value true into the field Gender in my
> database, and according to the Database Desktop the first 5 fields of my
> database are long integer, alpha, logical, logical and logical (they are
> "customer number","name","gender","whatever","whatever"... so gender is -
> according to the Database Desktop - the third field).

> Does anybody have an idea what I'm doing wrong ?

> Is there any to specify a new value for a specific field ? For example,
find
> a specific record and change the gender-field of the person ? [perhaps not
> the most crucial function to implement, but still.. ;-) ] SetFields seems
to
> apply to all fields...

> I'm using Delphi 4 on a Windows 98 based system.

> Thanks in advance for any hints :-)
> Martin Hamann, student of software engineering,
> Technical University of Denmark.
> http://www.dtu.dk



Fri, 05 Sep 2003 15:46:31 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Passing Untyped Arrays as arguments

2. Pb passing arguments through arrays (student)

3. passing procedures as arguments for another procedure in Turbo pascal

4. passing procedures as arguments for another procedure in Turbo pascal

5. passing procedures as arguments for another procedure in Tu

6. problem passing array values.

7. passing an array from an offset of the first element

8. Creating and passing Safe Arrays

9. passing variable sized arrays to a proc/func

10. Passing an array to SetField

11. Passing back array from function

12. pass a pointer to a array to a function

 

 
Powered by phpBB® Forum Software