473,320 Members | 1,945 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 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 2391
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: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.