Ask a Question related to ASP Database, Design and Development.
-
Steve G #1
Serial Numbers
Hi All:
I am trying to populate a database field that consists of incremented
(serial) numbers. This is the code I am trying to get to work:
objRs.AddNew
for i = 49999 to 50999
n2 = i + 1
response.write "n2=" & n2 & "<br>"
next
for n = 0 to 1000
objRs("bcksNo") = n2
next
objRs.Update
Tthe response.write indicates that the numbers are being generated properly,
however, I an getting an error message that the database can't be updated,
because its creating duplicate values so apparently the loop I have there is
not correct. I'm pretty new at this stuff, so really don't know how to
correct this.
Any help would be greatly appreciated
Steve
Steve G Guest
-
Serial Numbers for Freehand MX
Hello, It is unable for me to download the upgrade for Freehand MX. I have purchased Studio MX with Freehand 10 last year. This spring I... -
how to print forms with serial numbers?
I am trying to print work order forms or other Forms which have a serial number on them, anyone know how it is done? thank you! -
WSW (Studio MX) serial numbers seem to work now
Started downloading my Freehand MXa update a few minutes ago... -
Upgrade using Studio Serial Numbers
All, We are aware of the issue with being unable to use the Studio serial numbers to download the FreeHand MX version 11.0.1 installer. We hope... -
Serial IO
Are there any less expensive alternatives to the DirectCommunication Xtra for simple serial IO in Director? -
Tim Williams #2
Re: Serial Numbers
AddNew just adds one new record (row), so if you're trying to add multiple
records you'll have to AddNew for each one.
What is the response.write for? Just to check the numbers?
for i =1 to 100
response.write "i=" & i & "<br>"
objRs.AddNew
objRs("bcksNo") = i
next
objRs.Update
You'll have to make sure that the values you're inserting do not already
exist. You should also look into using SQL inserts rather than a recordset
to do your inserts.
Tim.
"Steve G" <steve@nospam.tnccreations.com> wrote in message
news:u4EIaC8RDHA.2188@TK2MSFTNGP10.phx.gbl...properly,> Hi All:
>
> I am trying to populate a database field that consists of incremented
> (serial) numbers. This is the code I am trying to get to work:
> objRs.AddNew
> for i = 49999 to 50999
> n2 = i + 1
> response.write "n2=" & n2 & "<br>"
> next
> for n = 0 to 1000
> objRs("bcksNo") = n2
> next
> objRs.Update
>
> Tthe response.write indicates that the numbers are being generatedis> however, I an getting an error message that the database can't be updated,
> because its creating duplicate values so apparently the loop I have there> not correct. I'm pretty new at this stuff, so really don't know how to
> correct this.
>
> Any help would be greatly appreciated
>
> Steve
>
>
Tim Williams Guest
-
Mark Schupp #3
Re: Serial Numbers
Are there any other columns in the table?
If so, do they have unique constraints on them?
Did you empty the table between trial runs?
--
Mark Schupp
--
Head of Development
Integrity eLearning
Online Learning Solutions Provider
[email]mschupp@ielearning.com[/email]
[url]http://www.ielearning.com[/url]
714.637.9480 x17
"Steve G" <steve@nospam.tnccreations.com> wrote in message
news:uuAk0z8RDHA.3880@tk2msftngp13.phx.gbl...again.> Thanks for your response Steven.
>
> Unfortunately, that is producing the same error message:
> Microsoft JET Database Engine error '80040e21'
>
> The changes you requested to the table were not successful because they
> would create duplicate values in the index, primary key, or relationship.
> Change the data in the field or fields that contain duplicate data, remove
> the index, or redefine the index to permit duplicate entries and try>
> Steve
>
> "Merkling, Steven" <Steven.Merkling@udlp.com> wrote in message
> news:uH%23Lsd8RDHA.3132@tk2msftngp13.phx.gbl...>> > try this
> >
> > for n = 0 to 1000
> > objRs.AddNew
> > objRs("bcksNo") = n
> > objRs.Update
> > next
> >
> >
>
Mark Schupp Guest



Reply With Quote

