Hi Yisrael,
EOF doesn't allow for the Access autonumbering feature. If you turn it off
(i.e., change the field's definition from "Autonumber" to "Number"), EOF
will handle the automatic primary key numbering for you.
Of course, this means that anybody adding to records from outside the EOF
framework might have a problem. In this instance, you may want to look into
implementing a VBA function to allocate a primary key value - if both EOF
and Access forms call this function, the two should work in harmony okay.
You would need to add the procedure (which would be declared Public and
return a Long value) to the Stored Procedures list in EOModeler, and then
assign it to the NextPrimaryKeyProcedureOperation.
Have a look at
$NEXT_ROOT\Documentation\Developer\EnterpriseObjects\Guide\FAQ2.html for
other approaches to primary key generation.
Scott
> This should be easy for the pros, but I am confused:
>
> I have a simple (ugh) Access database of seven fields. The
> primary key is
> "Recnum" which is an auto-number.
>
> My WO app is very basic, since all I want to do it add new
> contacts to this
> database. When I try to save a record, I get this:
>
> Exception occured while evaluating 'saveChanges', on
> target:<AddContact
> 0xaa5760>:
> SQLExecDirect in -[ODBCChannel evaluateExpression:(<ODBCSQLExpression:
> "UPDATE EO_PK_TABLE SET PK = 2 WHERE NAME = 'Contacts' AND PK = 0">)]
> 23000--1048: [Microsoft][ODBC Microsoft Access 97 Driver]
> Can't update 'PK';
> field not updatable.
>
> I know I am leaving out some info, but if anyone can offer me
> some guidance,
> I'd appreciate it.
>
>
> Yisrael A Spinoza
>