sql text search

Thread Solved

Join Date: Sep 2006
Posts: 65
Reputation: arvin2006 is an unknown quantity at this point 
Solved Threads: 4
arvin2006's Avatar
arvin2006 arvin2006 is offline Offline
Junior Poster in Training

sql text search

 
0
  #1
Mar 18th, 2009
what's wrong with the code, it doesn's display the data based on the SQL query:

Private Sub cmdSearch_Click()
On Error GoTo Notfound
squery = "": squery = "Select * from tblStation where Station like " & txtStation.Text & ""
Call ExecuteCommand
With Me
.txtStation = rs!Station
.cboCluster = rs!Cluster
.txtArea = rs!Area
.txtTelephone = rs!Telephone
.txtIPphone = rs!IPphone
.txtFax = rs!Fax
.txtManager = rs!Manager
End With

but with Field defined as Number in the database, it's so easy to search, it displays immediately, but what's wrong with the field defined as TEXT?

i've also tried operator LIKE, IN etc.., but no output.

any suggestions, thank you very much..
Reply With Quote Quick reply to this message  
Join Date: Mar 2009
Posts: 809
Reputation: vb5prgrmr will become famous soon enough vb5prgrmr will become famous soon enough 
Solved Threads: 147
vb5prgrmr vb5prgrmr is offline Offline
Practically a Posting Shark

Re: sql text search

 
0
  #2
Mar 18th, 2009
If you are quering a text field then you need to encompass what you are quering against/for with single ticks '
squery = "Select * from tblStation where Station like '" & txtStation.Text & "'"
if number then you don't need...
squery = "Select * from tblStation where Station like " & txtStation.Text & ""

Good Luck
Reply With Quote Quick reply to this message  
Join Date: Sep 2006
Posts: 65
Reputation: arvin2006 is an unknown quantity at this point 
Solved Threads: 4
arvin2006's Avatar
arvin2006 arvin2006 is offline Offline
Junior Poster in Training

Re: sql text search

 
0
  #3
Mar 18th, 2009
ok, thanks.. what about ADODB.Stream.

how could I add ADODB.Stream in declaration? as far a I know, the ADODB library has only 4 objects:Command, Recordset, Connection & Parameter.
Reply With Quote Quick reply to this message  
Join Date: Mar 2009
Posts: 809
Reputation: vb5prgrmr will become famous soon enough vb5prgrmr will become famous soon enough 
Solved Threads: 147
vb5prgrmr vb5prgrmr is offline Offline
Practically a Posting Shark

Re: sql text search

 
0
  #4
Mar 19th, 2009
Last time i used a stream object was with 2.5 (Microsoft ActiveX Data Objects 2.5).
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Dim A As ADODB.Stream
  2. Set A = New ADODB.Stream
  3.  
  4. 'open the adodb filestream and save the file locally so we can check its file size then close the adodb filestream object
  5. A.Type = adTypeBinary
  6. A.Open
  7. A.Write XMLHTTPOBJECT.responseBody
  8. A.SaveToFile App.Path & "\temp.jpg", adSaveCreateOverWrite
  9. A.Close
  10. Set A = Nothing

and if you can't tell I used it with XML 3.0 to save a file to disk from the web.

How you want to use it may require a new thread.

Good Luck
Reply With Quote Quick reply to this message  
Join Date: Sep 2006
Posts: 65
Reputation: arvin2006 is an unknown quantity at this point 
Solved Threads: 4
arvin2006's Avatar
arvin2006 arvin2006 is offline Offline
Junior Poster in Training

Re: sql text search

 
0
  #5
Mar 19th, 2009
ok, thank you. already found it, its a reference, not a component.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC