|
 |
asp_databases thread: Re: Database flu
Message #1 by shrij@v... on Mon, 22 Jan 2001 12:45:27 +0530 (IST)
|
|
Hi Mike,
What Imar said is true
But some correction abt the looping variable
(if you've not already figured it out)
For iLoopCount = 0 to iUbound ' loop for the number of items in the array.
Will insert split1(0) and split1(1)
strins = "insert into tbl (field1, field2"
'use iLoopCount in place of x (too much copy paste, Imar)
wrong --
varstr1 = cstr(trim(split1(x)))
right --
varstr1 = cstr(trim(split1(iLoopCount)))
wrong --
varstr2 = cstr(trim(split2(x)))
right --
varstr2 = cstr(trim(split2(iLoopCount)))
Is field1 the primary key of the table? That is, does it allow duplicates
or not? If it doesn't that might be the reason why you can't add the same record twice.
-- but it should throw an error, right ?
Regds
Shreekar Joshi
Message #2 by Imar Spaanjaars <Imar@S...> on Mon, 22 Jan 2001 11:09:52 +0100
|
|
Hi Shreekar,
Thanks for the correction. It indeed was caused by too much copy and paste ;-)
As for the error on duplicate keys that should be generated: it should
indeed be there, but I find that a lot of people have "On error resume
next" statements in their code, even while developing / debugging. So any
error thrown by the data engine might not show up in the page.
Imar
At 12:45 PM 1/22/2001 +0530, you wrote:
>Hi Mike,
>
>
>
>What Imar said is true
>
>But some correction abt the looping variable
>
>(if you've not already figured it out)
>
>
>
>For iLoopCount = 0 to iUbound ' loop for the number of items in the array.
>
>Will insert split1(0) and split1(1)
>
> strins = "insert into tbl (field1, field2"
>
>'use iLoopCount in place of x (too much copy paste, Imar)
|
|
 |