Hi
Why does insert with these character ( ' ! ) is not allow? It prompts me any Syntax Error whenever i have these characters. Please help.. Thank you.
Is there anything wrong the way i insert data below?
VB Code:
'" & text1.text & "'
Printable View
Hi
Why does insert with these character ( ' ! ) is not allow? It prompts me any Syntax Error whenever i have these characters. Please help.. Thank you.
Is there anything wrong the way i insert data below?
VB Code:
'" & text1.text & "'
What you've got is fine, as long as the rest of the line is OK.
Post the whole query.
Hi rj, i can't post the entire code because i am dealing with more than 50 fields. Just for ur info, i am using Access as my database.
VB Code:
SQL = "INSERT INTO tb_master (policyno,insuredname) VALUES ('" & TxtPoliNo.Text & "', '" & txtname.Text & "')"
That looks fine.
However, if the text boxes contain certain 'special' characters, you may have problems.
But I thought it would be OK like that. Try putting a / before certain characters before adding it to the DB...
If your fields are numerics.... then you don't need the '
Ah, yes. That's a possibility too.
hi rjlohan,
U mean this way?
John/'s
What can the flash does?
MC BRAIN, i know i do not need ' for numeric fields. It still give the same Error when i try to input special character like ' ! .
What other possibilities?
Ok... so you're problem is when you're trying to insert this:
"INSERT INTO Table VALUES( '" & "O'Donnel" & "')"
Isn't it?
You can't put those type of characters into a numeric field.
But the slash is a special character, which you use to precede certain other characters so they can be put in the DB correctly.
// = /
/' = '
/" = "
There are others. It may or may not work. I'm not sure.
Mc Brain, u are right. i had that problem.
rjlohan, it is text field but it still can't accpet special character like i mentioned early on
Try the other slash then: \