472,804 Members | 735 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,804 software developers and data experts.

Adding Records

Hi everyone, here's what id like to do.

I have a table with 2 fields, name and value

I need to be able to add multiple records quickly, for example I need to add

name value
abc 1
abc 2
abc 3
abc 4
abc 5
abc 6

etc etc, does each record have to be added separately, or is there a way I
can add a chosen number of records, lets say 10, and have the value field
increase by one each time?

sometimes I might have 30+ simple records that need adding quickly, and each
time the first records value will be one, and each record after will
increase by one, is there a way to solve this problem or does each record
have to be added separately?

Thanks

Jamie

Jul 19 '05 #1
6 2353
Jamie Fryatt wrote on 06 feb 2004 in
microsoft.public.inetserver.asp.general:
Hi everyone, here's what id like to do.

I have a table with 2 fields, name and value

I need to be able to add multiple records quickly, for example I need
to add

name value
abc 1
abc 2
abc 3
abc 4
abc 5
abc 6

etc etc, does each record have to be added separately, or is there a
way I can add a chosen number of records, lets say 10, and have the
value field increase by one each time?

sometimes I might have 30+ simple records that need adding quickly,
and each time the first records value will be one, and each record
after will increase by one, is there a way to solve this problem or
does each record have to be added separately?


Are you talking databases, or html tables, or ASP arrays?

Is "adding" adding new records, or adding values of fields?

If I surmize correctly, ASP + HTML table + new records adding:

<table>
<%
for n=1 to 100
t = "<tr><td>abc</td><td>" & n & "</td></tr>"
document.write t
next
%>
</table>

not tested

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 19 '05 #2
Evertjan. wrote on 06 feb 2004 in microsoft.public.inetserver.asp.general:
<table>
<%
for n=1 to 100
t = "<tr><td>abc</td><td>" & n & "</td></tr>"
document.write t
next
%>
</table>

not tested


response.write

so much for not testing ;-{

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 19 '05 #3
i am talking about adding records to an access db, using asp.

i need a user to be able to select a number of records to add , ie 20 click
go and a script somehow adds 20 records to the access db, but the value
field must increase by one each time one of the 20 records is added.

hope that makes snese
"Evertjan." <ex**************@interxnl.net> wrote in message
news:Xn********************@194.109.133.29...
Evertjan. wrote on 06 feb 2004 in microsoft.public.inetserver.asp.general:
<table>
<%
for n=1 to 100
t = "<tr><td>abc</td><td>" & n & "</td></tr>"
document.write t
next
%>
</table>

not tested


response.write

so much for not testing ;-{

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Jul 19 '05 #4
Jamie Fryatt wrote on 06 feb 2004 in
microsoft.public.inetserver.asp.general:
i am talking about adding records to an access db, using asp.

i need a user to be able to select a number of records to add , ie 20
click go and a script somehow adds 20 records to the access db, but
the value field must increase by one each time one of the 20 records
is added.

hope that makes snese


Oh yes it does, [though we are out of snese over here at present]

<%
'' open the database

a = 123

for n=a ot a+19
sql="INSERT INTO MyTable VALUES ('abc', " & n & ")"
CONNECTION.Execute(SQL)
next
%>

It would be better to use an autoincrement field
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 19 '05 #5
Jamie Fryatt wrote:
i am talking about adding records to an access db, using asp.

i need a user to be able to select a number of records to add , ie 20
click go and a script somehow adds 20 records to the access db, but
the value field must increase by one each time one of the 20 records
is added.

For real efficiency, make the [value] field an autonumber field (per
Evertjan's suggestion), and then create a table called Numbers containing a
single field called Limit in your database and add 20 (or however many
records you intend the user to be able to add at a single shot) records to
the table, like this:

1
2
3
4
5
6
....
20

Then create a saved parameter query in Access called qAddXrecords, with the
following SQL :

Insert Into tblName (name)
Select [pName] FROM Numbers
WHERE [limit] <= [pLimit]

Test the query by running it. Access will prompt you for the values for the
parameters. Once you have verified that it works, save the query, then, in
ASP, do this:

'open a connection, using a variable called "cn", then:
cn.qAddXrecords "abc",20

HTH,
Bob Barrows

PS. "name" and "value" are reserved keywords and should not be used for
object names in your database. See here for the list of words to avoid:
http://www.aspfaq.com/show.asp?id=2080
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 19 '05 #6
Bob Barrows wrote on 06 feb 2004 in
microsoft.public.inetserver.asp.general:
PS. "name" and "value" are reserved keywords and should not be used for
object names in your database. See here for the list of words to avoid:


The good thing about programming in another language than English is that
we nearly never encounter such mistakes.

We, overhere, would call the fields "naam and "waarde".

;-}

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 19 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Eric Petruzzelli | last post by:
If I fill my dataset and there is no data. The dataset is still created with zero rows (all columns are there). When I add my first row using the script below, it takes over 2 seconds to add??? If...
2
by: David | last post by:
Hi, I have an order form which has a field 'ProductID'. This form has a button on each record to open a new form linked by ProductID. This new form is a continuous form and obviously, only...
3
by: Jim Heavey | last post by:
Trying to figure out the technique which should be used to add rows to a datagrid. I am thinking that I would want an "Add" button on the footer, but I am not quite sure how to do that. Is that...
2
by: Tor Inge Rislaa | last post by:
Prevent Adding new records in DataGrid Hi I have a DataGrid that I want to open for editing but the user should not be able to add new records. When I set the ReadOnly = False it is possible...
6
by: Rudy | last post by:
Hi all, I know this is easy, just can't seem to get it. I have a windows form, and a text box, with a value already in it. I need to add that value to a table. It's just one value, so the entire...
8
by: shumaker | last post by:
I'm wondering if adding an autonumber primary key will improve the performance of a multiuser access database on a network share. I have a website that lists many tips for improving performance of...
9
by: Kadett | last post by:
Hi all, I have following problem: I'm creating a ListView (Details) control at run-time and filling it with some records (let's say 10 000). This operation seems to be quite fast, but when I call...
1
by: vbDavidC | last post by:
I am adding a new record to a table via a dataset/adapter. I have got the following to work for me but I am wondering if there is a better way to do this. I am having to have something in my...
2
by: darrel | last post by:
HI vb Wizards, good day, just wanted to ask if somebody there can help me iwth my problem. Am having difficulty in adding up records in my table, the table is in Microsoft Access format. It Like...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.