0

can u tell me how to find a part of string using an sql..
Dim inp As String

inp = InputBox("Enter the Search Term")
exec ("select * from solution_database where search_term like '" + inp+ "' ")

i want to get the records whose search_trem contains the string "inp" which is a part of search_trem(a column in my table)

i'm not able to use inp*
can u plz tell me

2
Contributors
5
Replies
6
Views
10 Years
Discussion Span
Last Post by guru511
0

Hi

open a Connection(Cn), and use this code:

dim RST As New ADODB.RecordSet
Dim sSQL As String
sSQL="Select * From MyTable Where UCASE(FName) Like '*" & ucase(text1.text)  & "*'"
Set RST =Nothing
RST.Open sSQl,Cn
IF RST.EOF Then
  MsgBox  "Records Not Found"
Else
  MsgBox "Record Found"
End IF

REgards
Veena

0

"select * from solution_database where ucase(search_term) like '*" + UCase(Text4.Text) + "*'"

itz not working

0

"select * from solution_database where ucase(search_term) like '*" + UCase(Text4.Text) + "*'"

itz not working

0

Hi,

what is ur back end..?
the above works for Access. Replace * with % for other db's

what is the field name ...? search_term..?
What is Solution_database...? table name..?


Regards
Veena

0

yeah.. i'm using access..
search_term is field name and solution_database is table name

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.