Re: Entering single quote into a database expl (O'Hare)
From: Trev Hunter (hunter_trev_at_hotmail.com)
Date: 02/15/04
- Next message: jmd: "vb.net program for automatic web file download ?"
- Previous message: Bernie Yaeger: "F1, keywordindex, and combobox dropdowns"
- In reply to: Bob E: "Entering single quote into a database expl (O'Hare)"
- Messages sorted by: [ date ] [ thread ]
Date: Sun, 15 Feb 2004 20:15:00 -0000
Bob,
If you're running SQL statements like:
"INSERT INTO Users (Name, Address) values ('" & szName & "','" & szAddress &
"')"
consider using parameters instead. They should handle all the problems with
single quotes, number and date formats etc.
Your SQL statement would change to:
"INSERT INTO Users (Name, Address) values (?,?)"
and add the parameters in the proper order to the parameters collection of
the command object.
You may find more help by posting in
microsoft.public.dotnet.framework.adonet
HTH,
Trev.
"Bob E" <anonymous@discussions.microsoft.com> wrote in message
news:4533342C-C176-496A-AEE7-3F266A57D521@microsoft.com...
> How can I insert a field name like O'Hare or O'Conner into a table. I
would rather not have to check every field entered to see if the character
( ' ) is in the field. I'm entering Streets, Names, Clients, etc. into a
table. Everything was going fine until the Name field (O'Hare) was entered.
Can I somehow map the Chr$(39) to Chr$ (96)? Any suggestions?
- Next message: jmd: "vb.net program for automatic web file download ?"
- Previous message: Bernie Yaeger: "F1, keywordindex, and combobox dropdowns"
- In reply to: Bob E: "Entering single quote into a database expl (O'Hare)"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|