Hi.

VPM 6.0b, VFP 6

I am trying to add a new record to a customer list that uses s<pre>cgpk to
generate the new primary key. I have opened the s<pre>DD2 table, located the
record for the table and PK field, then do a:

store smsydd2.default to lcRunIt
eval(RunIt)

The error I get is looking for a DD2DEFAULT table. Can someone advise me on
this table?

Thanks,

Gene Conrad

Re: Programmitically add default values by Sietse

Sietse
Thu Jun 24 01:22:24 CDT 2004

Hi Gene,

As I read it, you've already added the new record to the customer table, and
want to set the primary key?
Then use the REPLACE Command:
REPLACE PKField with NewPKValue
If tthe new customer record isn't addet yet, you can consider the insert
command:
INSERT INTO custtable (PKField) VALUES (NewPKValue)

The reason why you're using the EVAL() function puzzles me.. What value is
in the smsydd2.Default field for the current record?

Sietse Wijnker

"Gene Conrad" <gjconrad@ronan.net> wrote in message
news:40da371b_1@newsfeed.slurp.net...
> Hi.
>
> VPM 6.0b, VFP 6
>
> I am trying to add a new record to a customer list that uses s<pre>cgpk to
> generate the new primary key. I have opened the s<pre>DD2 table, located
the
> record for the table and PK field, then do a:
>
> store smsydd2.default to lcRunIt
> eval(RunIt)
>
> The error I get is looking for a DD2DEFAULT table. Can someone advise me
on
> this table?
>
> Thanks,
>
> Gene Conrad
>
>



Re: Programmitically add default values by Andrew

Andrew
Thu Jun 24 11:05:39 CDT 2004


"Gene Conrad" <gjconrad@ronan.net> wrote in message
news:40da371b_1@newsfeed.slurp.net...
: Hi.
:
: VPM 6.0b, VFP 6
:
: I am trying to add a new record to a customer list that uses s<pre>cgpk to
: generate the new primary key. I have opened the s<pre>DD2 table, located
the
: record for the table and PK field, then do a:
:
: store smsydd2.default to lcRunIt
: eval(RunIt)
:
: The error I get is looking for a DD2DEFAULT table. Can someone advise me
on
: this table?
:
: Thanks,
:

What you failed to mention, and which I am assuming from the naming above,
is that you are using the ProMatrix framework.

The s<pre>cgpk procedure assumes it has been called by the s<pre>cdef in
this procedure the DD2 table is used with alias dd2default (the table it can
not find when you use it).

It is extremely difficult to get around the ProMatrix framework if you are
not using it as intended.

Andrew R.