I want to know whether character pipe(|) can be inserted into access database using vb.Becos when i am trying to insert a | its giving me a syntax error
Printable View
I want to know whether character pipe(|) can be inserted into access database using vb.Becos when i am trying to insert a | its giving me a syntax error
Pipr can be inserted into the text field. make sure that you have quotes around it.
Iouri Boutchkine
[email protected]
I have written Sql statement this way
strsql = "Insert into questionnaire (questionnaire_name) values ( " & "'" & str & "'" & " )"
and value of str="ssssssssss|"
which is giving me syntax error for |
if i remove | from the string its fine
Hello,
try using the ascii representation of the pipe, i.e
str="ssssssssss"
strsql = "Insert into questionnaire (questionnaire_name) values ( " & "'" & str & "'" & chr(124) & "'" & "'" & " )"
Andrew
no this is appendinding another | to it and giving an error
Did you take the original one off the string first.
Use mid (str, 1, len(str) -1) & chr(124).
Failing that replace the | with another character that will not be used, such as \ or :, when it comes to reading them you can easily translate them back.
Andrew
hi!
I have just tried to insert a "|" with VB in Access (the way you suggested) and it works fine. Which kind of sintax error do you get, from the ODBC driver?
Jaime.