Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How to Insert more than one record at a time- with fixed set of values in one field

Explorer ,
Jan 12, 2010 Jan 12, 2010

Can someone guide as to how to insert multiple records at a time using ASP VBScript in Dreamweaver CS4 or ADDT.

If someone can guide then the exact problem is given below.

I have a MS access database with one table. The table has three fields. The first field is an autonumber field for ID number.

The second field contains string values- One out of 7 predefined values. One set of records consists of 7 records containing all the seven types of predefined values in fields no 1.

The third field is a numeric field and can contain integers.

I want that the user can enter data for the table using an ASP form in such a way that he enters one set of records at a time in one single screen. This way he will not have to remember that he has /has not entered all the seven set of values for the field no 1.

I am not creating fields with the 7 types of field1value as their names as it will increase the number of fields drastically.

Please help for dreamweaver ASP VBScript.

TOPICS
Server side applications
2.0K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 12, 2010 Jan 12, 2010

Use a form.  I suggest you find some tutorials out on the web for this basic process of INSERTing a record.  First stop is your dreamweaver help and then at adobe.com.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 12, 2010 Jan 12, 2010

You would create a form with fields for all 7 rows. Submit the form to the ASP script which will then generate an insert statement for each row.

I'm not exactly sure what your difficulty is, or what you mean in your subject line "with a fixed set of values in one field". It's probably best to provide some example data.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 12, 2010 Jan 12, 2010

Exactly how do I create the ASP script for inserting multiple records in one operation from one form.

Kindly guide me considering the dreamweaver environment.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 12, 2010 Jan 12, 2010

>Exactly how do I create the ASP script for

>inserting multiple records in one operation from one form.

What level of experience do you have with ASP? Which language are you using with it (VB or JS)?

>Kindly guide me considering the dreamweaver environment.

The Dreamweaver environment is not a consideration for this...what you want to achieve falls outside of DW's capabilities. You need to code this by hand.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 13, 2010 Jan 13, 2010

I am using VBScript and am having general experience with coding in ASP. But I can probably understand the coding with your help.

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 13, 2010 Jan 13, 2010

Since you have a fixed set of entries (7), the simplest way would be to just create 7 insert statements that insert the values from the form. If you want to get creative, you can name your form elements for each row using a sequential number, then use a loop in your script to process each one. Of course, make sure you validate every piece of data coming from the form before inserting.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 16, 2010 Jan 16, 2010

I have successfully inserted seven records in one form submit operation by looping through the command object execute method.

However, the data that is being inserted by the command object is repetition of the first record and the command object is not taking any data from the text boxes for the second record onwards. In this I had used the isert record behavious generated by DW CS4 and modified it to suit my requirement. However, the data inserted in the first row is getting repeated in all the seven rows.

Please help.

Also advise if there are any free dreamweaver server side validation extensions available.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 16, 2010 Jan 16, 2010
LATEST

You will need to show us your script to be able to figure out where the problem.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines