Re: Single quote
From: Al Reid (areidjr_at_reidDASHhome.com)
Date: 06/16/04
- Next message: Ken Halter: "Re: Visual Basic At the Movies"
- Previous message: Larry Serflaten: "Re: Visual Basic At the Movies"
- In reply to: DNagel: "Re: Single quote"
- Next in thread: Saga: "Re: Single quote"
- Reply: Saga: "Re: Single quote"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 16 Jun 2004 18:24:17 -0400
I can't say I disagree at all with your statement. We all know of the
performance and SQL injection issues. I personally, use SP's for everything
that I put into production. However, sometimes one needs to do something
quick and dirty for a prototype or to test a concept. For those cases it is
useful to know your way around the "single quote" problem.
--
Al Reid
"It ain't what you don't know that gets you into trouble. It's what you know
for sure that just ain't so." --- Mark Twain
"DNagel" <NOTGrandNagel@hotmail.com> wrote in message
news:%23NR5l9%23UEHA.2992@TK2MSFTNGP12.phx.gbl...
> Shahri wrote:
>
> > Hi all,
> > How to accomplish this from VB6 against Access database:
> > insert into table1(a, b, c)
> > values('Name','Co'de','Desc')
> > value for column b has a single quote and causing problem.
> > Thanks in advance,
> > Shahri
> >
>
> The other two replies cirle around the issue of single quotes
> by asking you to modify your data from code... the end result
> is as desired, but none-the-less it requires that you interact
> with the data in a fashion that can possibly be a source of an
> error... we all make errors... I certainly do <g>
>
> I would recommed looking into using Parameterized SQL statements.
> They offer the ability to push anything you want into the
> database without modifying the original data, as well as offer
> performance benefits such as the ability to retain your query
> in the cache and not have to reparse it each time it's run.
>
> On larger systems this yields huge resource savings and speeds
> up ALL the applications that hit the database.
>
> On smaller systems it may not show the performance benefits, but
> it will allow you to pass data 'unhandled' and it's good practice
> for when you hit the big-time...
>
> Ask any dba about them to see what they think of the idea...
>
> D.
- Next message: Ken Halter: "Re: Visual Basic At the Movies"
- Previous message: Larry Serflaten: "Re: Visual Basic At the Movies"
- In reply to: DNagel: "Re: Single quote"
- Next in thread: Saga: "Re: Single quote"
- Reply: Saga: "Re: Single quote"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|