Re: Problem updating Recordset
- From: "Camper Joe" <CamperJoe@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 28 Nov 2005 00:22:03 -0800
Hi Mark
Thanks for the info. I learnt quite alot.
I see they state that if I change it to:
rs.open "SELECT * FROM tblCustomers WHERE tblCustomersID = " &
cint(request.querystring("item"))
then I should be safe.
But I will definitly keep it in mind.
Thanks.
Camper Joe.
"Mark J. McGinty" wrote:
> 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
> >>
> >>
> >>
>
>
>
.
- References:
- Re: Problem updating Recordset
- From: Daniel Crichton
- Re: Problem updating Recordset
- From: Mark J. McGinty
- Re: Problem updating Recordset
- Prev by Date: Re: Problem updating Recordset
- Next by Date: Re: Find value associated with check constraint
- Previous by thread: Re: Problem updating Recordset
- Next by thread: Simple Question
- Index(es):
Relevant Pages
|
|