This topic is locked

AutoNumber Field

6/15/2005 7:37:41 AM
ASPRunnerPro General questions
G
grosskopf author

I would like a primary key field to automatically select the next available number when the add button is clicked. Can the software do this?

Sergey Kornilov admin 6/16/2005

Hi,
you need to set this field in your database as autonumber (for MS Access) or INTEGER with identity value set to YES (for MS SQL).
Don't forget to remove this field from the Add page.

G
grosskopf author 6/16/2005

I changed the SQL field to an identity field, set the seed value to 21857 (since this is the next number in the databse) and the increment to 1. I also removed the field from the add page.
I added a new record and it appeard to work correctly yet 21857 is nowhere to be found on my list. Any other suggestions? I'm probably missing something simple.
Thanks

G
grosskopf author 6/16/2005

Just to add to me previous response. The problem was that the sql server index was incorrect. I fixed that and now if I do a select on the SQL server I get the next number correctlt but ASP page does not show it at all.
Does this make sense?

Sergey Kornilov admin 6/16/2005

I would recommend to create a brand new project in ASPRunnerPro against this database table to make sure everything works fine.

G
grosskopf author 6/16/2005

OK, I did what you suggested. Here's what happened. I added just one of the two tables I am working with for testing. When I did this, it worked great. However, as soon as I add a second table with the manual enter of SQL query. It stops showing not only new records but any records that I enetered with the single table. Here's is the sql query I am using. Can I enter anything here to make it work. The index field is the Serial_Number field. Thanks
select Serial_Number,E_Date, Notes, entered, s.SO_Number,s.Pos_NUmber,b.t_item, b.t_dsca, b.t_cuno, b.t_nama, b.t_namc, b.t_name, b.Deliv_1, b.Deliv_2, b.total

from Serial_Number s

inner join baan_info b on

(s.SO_Number = b.t_orno and

s.Pos_NUmber = b.t_pono)

Sergey Kornilov admin 6/17/2005

Hi,
does this query work in the SQL Query Analyser?
If you want me to investigate this error please zip and send to support@xlinesoft.com your project file along with your database creation script or database itself.

K
Keith@Caterpillar 6/20/2005

I understand using autonumber for MS ACCESS and identity seed for MS SQL. Is there a way to specify the sequence table to use when using ORACLE so you can get a sequence.nextval for assigning the primary key to a new record?
Thanks,

Keith