Re: Duplicate Record with .ADDNEW
- From: "Mark McGinty" <mmcginty@xxxxxxxxxxxxxxx>
- Date: Mon, 13 Nov 2006 08:54:22 -0800
"Ralph" <nt_consulting64@xxxxxxxxx> wrote in message
news:bemdnVe0bIVR6sXYnZ2dnUVZ_rydnZ2d@xxxxxxxxxxxxxxx
<goadswapnil@xxxxxxxxx> wrote in message
news:1163403862.936003.144180@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hey Guys you are not concentrating on the real source of the problem.<snipped>
The first and foremost is that there's a serious flaw in the schema of
this table.
reason
Mark McGinty wrote:
"Ralph" <nt_consulting64@xxxxxxxxx> wrote in message
news:w46dnb7uCuhu5MvYnZ2dnUVZ_vSdnZ2d@xxxxxxxxxxxxxxx
However, I wouldn't use the Connection.Execute method. There is no
it,to
return a recordset. Use the Command object instead.
Connection.Execute accepts adExecuteNoRecords as an option, just like
Command.Execute. If he's just going to construct ad-hoc SQL and exec
thewhat's the difference? If you suggested parameterizing, and/or reusing
overhead,command object, I could see a reason fot the extra code and object
there.but from the looks of the OP's code, I'm not sure what he has to gain
<snipped>
The reason to avoid a recordset, is simply because it is not needed. You
can
certainly use a recordset object to execute a query and then tell it to
ignore the return, but why go there?
Whoa, hold the phone <the sound of all 18 wheels of a big rig locking-up on
dry pavement pervades the air for what seems an eternity> (damn that was a
long pseudo-tag!) :-)
We were talking about Connection.Execute, with adExecuteNoRecords passed in
options.
I could see your point about creating a recordset to exec a
non-row-returning SQL statement, that would be pretty whacked -- but that's
not at all where this spin-off thread started.
Let's recap...
You suggested Command.Execute instead of Connection.Execute;
I asked why?
You cited unnecessary recordset creation;
I offered adExecuteNoRecords;
You said, "I'll take 'Insane usage of Recordsets' for $100, Alex";
I heard the low screeching howl of huge split-rim tires, still moving though
they've ceased to roll;
(Alex Trebek had to remind you to phrase your answer as a question)
(I'm not sure who got the Daily Double)
Did I miss something? :-)
-Mark
I heartily agree with both of you. Especially at this point - to
paraphrase
Sherlock Holmes - Once you remove the impossible, whatever remains, no
matter how improbable, is the possible.
AddNew/Update is known the be buggy. It's gone.
Using a Recordset when is one is not needed (especially if using As New)
may
be an issue - it's gone.
Now I believe you guys are correct. Adding a non-duplicate key would be a
good solution, and there is obviously something going on.
-ralph
.
- Follow-Ups:
- Re: Duplicate Record with .ADDNEW
- From: Ralph
- Re: Duplicate Record with .ADDNEW
- References:
- Duplicate Record with .ADDNEW
- From: mamin
- Re: Duplicate Record with .ADDNEW
- From: JP Bless
- Re: Duplicate Record with .ADDNEW
- From: mamin
- Re: Duplicate Record with .ADDNEW
- From: mamin
- Re: Duplicate Record with .ADDNEW
- From: Ralph
- Re: Duplicate Record with .ADDNEW
- From: mamin
- Re: Duplicate Record with .ADDNEW
- From: Ralph
- Re: Duplicate Record with .ADDNEW
- From: Mark McGinty
- Re: Duplicate Record with .ADDNEW
- From: goadswapnil
- Re: Duplicate Record with .ADDNEW
- From: Ralph
- Duplicate Record with .ADDNEW
- Prev by Date: Re: Duplicate Record with .ADDNEW
- Next by Date: Re: Duplicate Record with .ADDNEW
- Previous by thread: Re: Duplicate Record with .ADDNEW
- Next by thread: Re: Duplicate Record with .ADDNEW
- Index(es):
Relevant Pages
|