|
-
September 12th, 2001, 06:57 AM
#1
Database
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
-
September 12th, 2001, 07:16 AM
#2
Re: Database
Pipr can be inserted into the text field. make sure that you have quotes around it.
Iouri Boutchkine
[email protected]
-
September 12th, 2001, 08:09 AM
#3
Re: Database
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
-
September 12th, 2001, 08:21 AM
#4
Re: Database
Hello,
try using the ascii representation of the pipe, i.e
str="ssssssssss"
strsql = "Insert into questionnaire (questionnaire_name) values ( " & "'" & str & "'" & chr(124) & "'" & "'" & " )"
Andrew
-
September 12th, 2001, 08:34 AM
#5
Re: Database
no this is appendinding another | to it and giving an error
-
September 12th, 2001, 08:43 AM
#6
Re: Database
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
-
September 12th, 2001, 08:44 AM
#7
Re: Database
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.
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
|