|
-
Jan 16th, 2002, 07:50 PM
#1
Thread Starter
Addicted Member
Insert problem
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?
-
Jan 16th, 2002, 08:01 PM
#2
PowerPoster
What you've got is fine, as long as the rest of the line is OK.
Post the whole query.
-----------------------------------------
-RJ
[email protected]
-----------------------------------------
-
Jan 16th, 2002, 08:31 PM
#3
Thread Starter
Addicted Member
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 & "')"
-
Jan 16th, 2002, 08:38 PM
#4
PowerPoster
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...
-----------------------------------------
-RJ
[email protected]
-----------------------------------------
-
Jan 16th, 2002, 08:38 PM
#5
-
Jan 16th, 2002, 08:44 PM
#6
PowerPoster
Ah, yes. That's a possibility too.
-----------------------------------------
-RJ
[email protected]
-----------------------------------------
-
Jan 16th, 2002, 08:49 PM
#7
Thread Starter
Addicted Member
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?
-
Jan 16th, 2002, 08:52 PM
#8
-
Jan 16th, 2002, 08:52 PM
#9
PowerPoster
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.
-----------------------------------------
-RJ
[email protected]
-----------------------------------------
-
Jan 16th, 2002, 09:20 PM
#10
Thread Starter
Addicted Member
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
-
Jan 16th, 2002, 09:34 PM
#11
PowerPoster
Try the other slash then: \
-----------------------------------------
-RJ
[email protected]
-----------------------------------------
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|