
View Message Thread (49 replies)
| Instr problem in VB5 |
 |
From: Dennis Rose Date Posted: 6/2/2010 10:32:00 AM
I need to use the following string as a "Search String" in an Instr
instruction:
<name part="first">
The quotes around the word "first" are causing the instruction to fail.
How can I test for this Search String?
I have checked Google and tried single quotes and double quotes and chr(34)
around around the word "first" all with no success.
The code I am using is"
SearchString = "<name part="first">"
StringPos = Instr(1, InputDataLine, StringSearch)
If StringPos > 0 then ......
Please help!!

From: Dennis Rose Date Posted: 6/2/2010 10:33:00 AM
I need to use the following string as a "Search String" in an Instr
instruction:
<name part="first">
The quotes around the word "first" are causing the instruction to fail.
How can I test for this Search String?
I have checked Google and tried single quotes and double quotes and chr(34)
around around the word "first" all with no success.
The code I am using is"
SearchString = "<name part="first">"
StringPos = Instr(1, InputDataLine, StringSearch)
If StringPos > 0 then ......
Please help!!

From: Dennis Rose Date Posted: 6/2/2010 10:34:00 AM
I need to use the following string as a "Search String" in an Instr
instruction:
<name part="first">
The quotes around the word "first" are causing the instruction to fail.
How can I test for this Search String?
I have checked Google and tried single quotes and double quotes and chr(34)
around around the word "first" all with no success.
The code I am using is"
SearchString = "<name part="first">"
StringPos = Instr(1, InputDataLine, StringSearch)
If StringPos > 0 then ......
Please help!!

From: Dennis Rose Date Posted: 6/2/2010 10:35:00 AM
I need to use the following string as a "Search String" in an Instr
instruction:
<name part="first">
The quotes around the word "first" are causing the instruction to fail.
How can I test for this Search String?
I have checked Google and tried single quotes and double quotes and chr(34)
around around the word "first" all with no success.
The code I am using is"
SearchString = "<name part="first">"
StringPos = Instr(1, InputDataLine, StringSearch)
If StringPos > 0 then ......
Please help!!

From: Patrice Date Posted: 6/2/2010 10:45:00 AM
Hello,
> <name part="first">
>
> The quotes around the word "first" are causing the instruction to fail.
You can include " in a literal string by using "" (double the double quote
character). Here it will be :
SearchString = "<name part=""first"">"
> I have checked Google and tried single quotes and double quotes and
> chr(34)
> around around the word "first" all with no success.
If you really tried
SearchString = "<name part=""first"">" then it could be be that you really
don't have this string in "InputDataLine".
For example could it be that you are searching actually for :
<name part="first"/>
Note the trailing /> rather than just >
What if you try with hardcoded values to make sure this is not just that
InputDataLine doesn't contain what you think ?
--
Patrice

From: Patrice Date Posted: 6/2/2010 10:46:00 AM
Hello,
> <name part="first">
>
> The quotes around the word "first" are causing the instruction to fail.
You can include " in a literal string by using "" (double the double quote
character). Here it will be :
SearchString = "<name part=""first"">"
> I have checked Google and tried single quotes and double quotes and
> chr(34)
> around around the word "first" all with no success.
If you really tried
SearchString = "<name part=""first"">" then it could be be that you really
don't have this string in "InputDataLine".
For example could it be that you are searching actually for :
<name part="first"/>
Note the trailing /> rather than just >
What if you try with hardcoded values to make sure this is not just that
InputDataLine doesn't contain what you think ?
--
Patrice

From: Patrice Date Posted: 6/2/2010 10:47:00 AM
Hello,
> <name part="first">
>
> The quotes around the word "first" are causing the instruction to fail.
You can include " in a literal string by using "" (double the double quote
character). Here it will be :
SearchString = "<name part=""first"">"
> I have checked Google and tried single quotes and double quotes and
> chr(34)
> around around the word "first" all with no success.
If you really tried
SearchString = "<name part=""first"">" then it could be be that you really
don't have this string in "InputDataLine".
For example could it be that you are searching actually for :
<name part="first"/>
Note the trailing /> rather than just >
What if you try with hardcoded values to make sure this is not just that
InputDataLine doesn't contain what you think ?
--
Patrice

From: Bob Butler Date Posted: 6/2/2010 10:49:00 AM
"Dennis Rose" <Dennis Rose@discussions.microsoft.com> wrote in message
news:1EDE11CE-8D50-4A18-B59C-95C45B849EFC@microsoft.com...
>I need to use the following string as a "Search String" in an Instr
> instruction:
>
> <name part="first">
>
> The quotes around the word "first" are causing the instruction to fail.
>
> How can I test for this Search String?
>
> I have checked Google and tried single quotes and double quotes and
> chr(34)
> around around the word "first" all with no success.
>
> The code I am using is"
> SearchString = "<name part="first">"
SearchString = "<name part=""first"">" ' two quotes in a row gives one quote
in the result
> StringPos = Instr(1, InputDataLine, StringSearch)
> If StringPos > 0 then ......
>
> Please help!!

From: Patrice Date Posted: 6/2/2010 10:49:00 AM
Hello,
> <name part="first">
>
> The quotes around the word "first" are causing the instruction to fail.
You can include " in a literal string by using "" (double the double quote
character). Here it will be :
SearchString = "<name part=""first"">"
> I have checked Google and tried single quotes and double quotes and
> chr(34)
> around around the word "first" all with no success.
If you really tried
SearchString = "<name part=""first"">" then it could be be that you really
don't have this string in "InputDataLine".
For example could it be that you are searching actually for :
<name part="first"/>
Note the trailing /> rather than just >
What if you try with hardcoded values to make sure this is not just that
InputDataLine doesn't contain what you think ?
--
Patrice

From: Bob Butler Date Posted: 6/2/2010 10:50:00 AM
"Dennis Rose" <Dennis Rose@discussions.microsoft.com> wrote in message
news:1EDE11CE-8D50-4A18-B59C-95C45B849EFC@microsoft.com...
>I need to use the following string as a "Search String" in an Instr
> instruction:
>
> <name part="first">
>
> The quotes around the word "first" are causing the instruction to fail.
>
> How can I test for this Search String?
>
> I have checked Google and tried single quotes and double quotes and
> chr(34)
> around around the word "first" all with no success.
>
> The code I am using is"
> SearchString = "<name part="first">"
SearchString = "<name part=""first"">" ' two quotes in a row gives one quote
in the result
> StringPos = Instr(1, InputDataLine, StringSearch)
> If StringPos > 0 then ......
>
> Please help!!

Would you like to track this thread?
By adding this News Thread to your Favorites Area you can refer to it later with just a click of the mouse.
Also you can optionally be notified instantly whenever there are any replies
posted to this Thread. To add this Thread to your Favorites Area just click on the red arrow next to the subject of the thread above
.
|