Re: Problem updating Recordset
- From: "Mark J. McGinty" <mmcginty@xxxxxxxxxxxxxxx>
- Date: Sat, 26 Nov 2005 22:34:10 -0800
While you're googling, search for "SQL Injection", to learn why code like
this:
>> > rs.open "SELECT * FROM tblCustomers WHERE tblCustomersID = " &
>> > request.querystring("item")
is a very bad plan.
-Mark
"Camper Joe" <CamperJoe@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:EAABCE5F-9942-40B7-8B2A-62F5C5FF1FC7@xxxxxxxxxxxxxxxx
> Hi Daniel
>
> Currently it is the primary key. But I will check out the other solutions
> on
> that page.
>
> Thanks for the reply.
>
> Camper Joe.
>
> "Daniel Crichton" wrote:
>
>> Camper wrote on Thu, 17 Nov 2005 01:02:04 -0800:
>>
>> > Hi
>> >
>> > I've got a problem Updating a recordset. I open it up with:
>> >
>> > rs.open "SELECT * FROM tblCustomers WHERE tblCustomersID = " &
>> > request.querystring("item")
>> >
>> > rs("strFirstname") = request.form("strFirstname")
>> > yada
>> > yada
>> > wada
>> > rs.update
>> > rs.close
>> >
>> > When it has to update, it does the following:
>> >
>> > Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
>> > Query-based update failed because the row to update could not be found.
>> >
>> > Anybody got an idea?
>> >
>> > Thanks.
>> >
>> > Camper Joe.
>>
>> Googling for the error message brings up a lot of pages about this, such
>> as http://www.aspfaq.com/show.asp?id=2009
>>
>> You haven't got a primary key on your table. Therefore, there's no
>> underlying pointer to the original row in the table and the update fails.
>> I'd suggest making tblCustomerID your primary key as your query uses that
>> as
>> the unique identifier.
>>
>> Dan
>>
>>
>>
.
- Follow-Ups:
- Re: Problem updating Recordset
- From: Camper Joe
- Re: Problem updating Recordset
- References:
- Re: Problem updating Recordset
- From: Daniel Crichton
- Re: Problem updating Recordset
- Prev by Date: Re: adodc update
- Next by Date: Re: Problem updating Recordset
- Previous by thread: Re: Problem updating Recordset
- Next by thread: Re: Problem updating Recordset
- Index(es):
Relevant Pages
|
|