Punctuation ?
Mar 12, 2004
Hi
I have this simple and working well SQL-row:
MyCommand = New SqlDataAdapter("SELECT * From Tbl_Table where Type = '" & TestType.tostring & "' ", MyConnection)
-----------
Then I have this one which I am very proud of because I can retrieve any word or part of word from the Item-field:
Test_Text=(Session("session-Text").tostring)
Dim val1, val2, val3 as string
val1 = Test_Text
val2 = "%"
val3= val1 + val2
MyCommand = New SqlDataAdapter("SELECT * From Tbl_Table where Item Like '%" & val1 & " %' OR Item Like '%" & val3 & " %' ", MyConnection)
------------
The problem is:
When I try to merge these two in one big "AND" row as shown below, It only cares of picking up the Test_Text string and ignores totaly the TestType one!
I guess it is a matter of punctuation, can any one help me? Thanks.
MyCommand = New SqlDataAdapter("SELECT * From Tbl_Table where Type = '" & TestType.tostring & "' AND Item Like '%" & val1 & " %' OR Item Like '%" & val3 & " %'", MyConnection)
View 3 Replies
Oct 24, 2005
Has anyone had to deal with removing punctuation (commas, apostrophes,etc.) from a column? What is the most efficient way to have thesecharacters automatically removed from the column?
View 3 Replies
View Related
Jul 20, 2005
Hi,I have a table of text. I need to search for whole words within this text...For example, I need to be able to search for records that contain 'dog' butnot return 'hotdog' or 'dogma' for example.I am doing this by throwing a space around both the records in the table andthe search word like this:WHERE (' ' + Text + ' ') Like ('% ' + Search + ' %')The problem is that punctuation needs to be stripped out of the text so thatit will still find "...walking the dog."Is there a way to update, converting a certain set of characters intoanother character (i.e. a space) and/or to do the same thing during the wordsearch query itself?Thanks!
View 5 Replies
View Related
Dec 9, 2003
Please can anyone help me - I am trying to establish whether there are any reserved symbols in SQL passwords
eg % £ " $ ( / < * etc
The SQL BOL has a list of reserved words but I cannot find a list of reserved symbols.
We have a problem where by for example if the main part of the password is "test" and my user wants to add a punctuation mark into this we get "You are attempting to use an invalid character message"
Specifically
"test$" is accepted "$test" is not accepted
None of "te+st" "+test" "test+" are accepted.
Has anyone else come across this and found a list of the logic that produces these results so I can point my users in the right direction?
Cheers
View 3 Replies
View Related