943,950 Members | Top Members by Rank

Ad:
Mar 18th, 2009
0

sql text search

Expand Post »
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..
Similar Threads
Reputation Points: 15
Solved Threads: 4
Junior Poster in Training
arvin2006 is offline Offline
69 posts
since Sep 2006
Mar 18th, 2009
0

Re: sql text search

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
Reputation Points: 156
Solved Threads: 296
Posting Virtuoso
vb5prgrmr is offline Offline
1,670 posts
since Mar 2009
Mar 18th, 2009
0

Re: sql text search

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.
Reputation Points: 15
Solved Threads: 4
Junior Poster in Training
arvin2006 is offline Offline
69 posts
since Sep 2006
Mar 19th, 2009
0

Re: sql text search

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
Reputation Points: 156
Solved Threads: 296
Posting Virtuoso
vb5prgrmr is offline Offline
1,670 posts
since Mar 2009
Mar 19th, 2009
0

Re: sql text search

ok, thank you. already found it, its a reference, not a component.
Reputation Points: 15
Solved Threads: 4
Junior Poster in Training
arvin2006 is offline Offline
69 posts
since Sep 2006

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Can someone help me solve this visual basic 6.0 / SQL statement error I am getting?
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Simple Excel Macro (VBA)





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC