Copy link to clipboard
Copied
I'm using Dreamweaver 3, and have created dynamic tables using the ASP tools. One wall I've hit:
when creating an Insert Record form, how do I set up the form to update an Auto-Increment field in Access?
I have what I think is a good book on Dreamweaver, but this function isn't discussed. If I omit the field from
the form, it leaves the field null and I get a database error, as I would expect.
Any help or links to documentation will be appreciated.
Joe
As others have said, the database should handle that field and it shouldn't appear either on the form on the update page or in the code that does the actual insert.
You do it slightly differently depending on whether you use the Insert Wizard or build the form by hand and then apply the Insert Server Behaviour.
If you use the wizard, when you select the form fields, make sure you click on auto-incrementing field and then click the "minus" icon, this will remove it from the form and it will not be
...
Copy link to clipboard
Copied
You should be able to set the column to auto-increment in your database table application when creating the column.
Here's more info found by searching google for ASP auto-increment.
http://www.w3schools.com/sql/sql_autoincrement.asp
Copy link to clipboard
Copied
I'll browse the web for some ASP references. I was asking from the point of view of Dreamweaver, if it has wizards or other automated functions that can enable this for me, much the way it creates the code for the rest of the ASP form. I'm not averse to learning to code it manually, but with the boatload of features built into Dreamweaver, I'll take the help where I can get it.
Thanks.
Copy link to clipboard
Copied
Maybe I don't understand what you are asking. You really shouldn't update an auto-increment field. That's the job of the DBMS. Are you trying to change the value that the DBMS provides?
Copy link to clipboard
Copied
Maybe the title "Update field.." was misleading; I changed it. I'm referring to new records, not existing ones.
One of the fields is an auto-number field in MsAccess. When a user enters a new record using the Insert Record form
I created in Dreamweaver, I can't figure out how to have that value be automatically filled in, the way it would in native forms
in Access. If I omit the field from the insert form, the post is rejected because it leaves the auto-number field null.
I hope this explains it better. This might be a topic for an ASP forum, not specific to Dreamweaver.
Thanks.
Copy link to clipboard
Copied
As bregent and myself has previously stated, use your database management application to assign the column as an auto-increment field.
The link I provided in the first reply didn't help?
Copy link to clipboard
Copied
You can't simply remove the field from the form. You need to make sure that field is not part of the recordset/insert statement.
Copy link to clipboard
Copied
As others have said, the database should handle that field and it shouldn't appear either on the form on the update page or in the code that does the actual insert.
You do it slightly differently depending on whether you use the Insert Wizard or build the form by hand and then apply the Insert Server Behaviour.
If you use the wizard, when you select the form fields, make sure you click on auto-incrementing field and then click the "minus" icon, this will remove it from the form and it will not be included in the auto-generated code, leaving MS Access free to handle it itself.
If you build the form by hand, do not include a form element for the auto-incrementing field, then when you apply the Insert behaviour it will not be included in the auto-generated code, leaving MS Access free to handle it itself.
Copy link to clipboard
Copied
Some days will be better than others. The correct answers were in the discussion - omit the auto-number field
from the recordset. I was sure that I had done that, but maybe didn't save the changes, maybe what, I don't know.
Thanks for the replies and sorry for the frustration and confusion.
jb
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more