Click here to Skip to main content
15,909,827 members
Home / Discussions / Database
   

Database

 
GeneralRe: Nested Transaction between ADO.NET and T-SQL Pin
Sanjeev Kumar26-Aug-04 13:59
Sanjeev Kumar26-Aug-04 13:59 
GeneralRe: Nested Transaction between ADO.NET and T-SQL Pin
Colin Angus Mackay27-Aug-04 6:07
Colin Angus Mackay27-Aug-04 6:07 
GeneralParse sql query without executing Pin
tocheng00525-Aug-04 11:42
susstocheng00525-Aug-04 11:42 
GeneralRe: Parse sql query without executing Pin
S Sansanwal25-Aug-04 16:31
S Sansanwal25-Aug-04 16:31 
GeneralRe: Parse sql query without executing Pin
tocheng00526-Aug-04 12:07
susstocheng00526-Aug-04 12:07 
GeneralDataSet with GUIDs Pin
mikasa25-Aug-04 11:21
mikasa25-Aug-04 11:21 
GeneralRe: DataSet with GUIDs Pin
mikasa27-Aug-04 3:05
mikasa27-Aug-04 3:05 
GeneralDealing with special characters in SQL queries Pin
david@mindplay.com25-Aug-04 10:36
david@mindplay.com25-Aug-04 10:36 
Alright, I'm about ready to yank what's left of my hair out. Hopefully someone out there has the answer to my problem. Here it is…

I want to allow users to type any damn fool thing they want into a text field and then store that string in a database. I don’t like the idea of disallowing certain characters. I’d like to figure a way to store any string in the database regardless of what silly characters the user inputs.

I’ve done quite a bit of looking around on the internet for the answer to this problem. Surprisingly no one seems to have a good answer. I thought this would be easy and that I would find a viable answer right away. I have to admit that I am a little disappointed with the development community as a whole right now. For shame!

Anyway, I figured out how to deal with apostrophes and “single-qoutes”. ‘ this character whatever you call it anyway. If you simply double-up an apostrophe in a SQL query, for example: the string “Mr. O’Connell” would be changed to “Mr. O’’Connell”. This seems to work fine. Here’s the problem that’s killing me, what if the string was “Mr. O”Connell”, now what do you do. Obviously, it would be stupid to use a quotation mark it this way, but I want to allow users to indulge their stupidity. How in the heck do you put that in a SQL query without invoking a database error? Also, what about other special characters like: \ @ # $ % and so on. What if the string was something like this “Mr. “\@#$’%”. There has got to be an answer.

Not that it matters a whole lot, but the application is written in VB.Net and I am querying against a MS Access database. Access is just for now, when the application is finished users will have the option of several different providers such as: Access, SQL Server or My SQL.

Please Help

GeneralRe: Dealing with special characters in SQL queries Pin
Colin Angus Mackay25-Aug-04 11:13
Colin Angus Mackay25-Aug-04 11:13 
GeneralRe: Dealing with special characters in SQL queries Pin
david@mindplay.com25-Aug-04 11:28
david@mindplay.com25-Aug-04 11:28 
GeneralRe: Dealing with special characters in SQL queries Pin
Colin Angus Mackay25-Aug-04 12:22
Colin Angus Mackay25-Aug-04 12:22 
GeneralRe: Dealing with special characters in SQL queries Pin
mikasa25-Aug-04 11:24
mikasa25-Aug-04 11:24 
GeneralRe: Dealing with special characters in SQL queries Pin
david@mindplay.com25-Aug-04 11:51
david@mindplay.com25-Aug-04 11:51 
GeneralRe: Dealing with special characters in SQL queries Pin
david@mindplay.com25-Aug-04 12:13
david@mindplay.com25-Aug-04 12:13 
GeneralRe: Dealing with special characters in SQL queries Pin
mikasa26-Aug-04 3:38
mikasa26-Aug-04 3:38 
GeneralRe: Dealing with special characters in SQL queries Pin
Colin Angus Mackay26-Aug-04 12:01
Colin Angus Mackay26-Aug-04 12:01 
GeneralRe: Dealing with special characters in SQL queries Pin
mikasa27-Aug-04 3:05
mikasa27-Aug-04 3:05 
AnswerRe: Dealing with special characters in SQL queries Pin
ToolJoe11-Aug-09 10:50
ToolJoe11-Aug-09 10:50 
QuestionWhat's faster? Pin
Chodici Mrkev24-Aug-04 20:46
Chodici Mrkev24-Aug-04 20:46 
GeneralDELETE table, ignore key constraints Pin
Christian Graus24-Aug-04 12:54
protectorChristian Graus24-Aug-04 12:54 
Questionhow do I write to an access DB using ADO & VisualC++ ? Pin
Eduardo M. Rey24-Aug-04 8:48
Eduardo M. Rey24-Aug-04 8:48 
AnswerRe: how do I write to an access DB using ADO & VisualC++ ? Pin
S Sansanwal24-Aug-04 11:23
S Sansanwal24-Aug-04 11:23 
GeneralUsing ADO with Visual C++ Pin
Eduardo M. Rey24-Aug-04 8:41
Eduardo M. Rey24-Aug-04 8:41 
GeneralRe: Using ADO with Visual C++ Pin
S Sansanwal24-Aug-04 11:27
S Sansanwal24-Aug-04 11:27 
GeneralRe: Using ADO with Visual C++ Pin
Eduardo M. Rey25-Aug-04 4:18
Eduardo M. Rey25-Aug-04 4:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.