1

Topic: Problem with obtaining of the identifier of a line

Good afternoon!
There is a table in which there is a field autoincremental NomPP
If the table is table ACCESS - the following code is fulfilled correctly:

Set db = CurrentDb
Set rst = db. OpenRecordset ("TableName")
With rst
.AddNew
ret =! []
.Update

The parameter ret - receives number correct
If the table is table reference MS SQL the following code is fulfilled with an error:

Set db = CurrentDb
Set rst = db. OpenRecordset ("TableName", dbOpenDynamic, dbSeeChanges)
With rst
.AddNew
ret =! []
.Update

! [] at the moment of obtaining it is equal null.
How it is possible to receive parameter?
In advance thanks.

2

Re: Problem with obtaining of the identifier of a line

Any. Number in MS SQL is appropriated at a record insertion. Access at switching-on of an insert mode of record reserves under it number in the field of the counter (if it is), and MS SQL - is not present. Number forms, when there is a record in the table.
Personally I got out through time stamp (or as it is called) Appropriated a variable value of current time, then this variable appropriated to a field of an appropriate format. Produced a record insertion. And then find record with a field equal to variable value and read out record number.
Somewhere so.

3

Re: Problem with obtaining of the identifier of a line

.AddNew
.Update
.Bookmark =.LastModified
ret =! []

4

Re: Problem with obtaining of the identifier of a line

Anatoly (Kiev);
Thanks, all turned out...