| | |
sql text search
Thread Solved |
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..
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..
•
•
Join Date: Mar 2009
Posts: 809
Reputation:
Solved Threads: 147
If you are quering a text field then you need to encompass what you are quering against/for with single ticks '
if number then you don't need...
Good Luck
squery = "Select * from tblStation where Station like '" & txtStation.Text & "'"
squery = "Select * from tblStation where Station like " & txtStation.Text & ""Good Luck
•
•
Join Date: Mar 2009
Posts: 809
Reputation:
Solved Threads: 147
Last time i used a stream object was with 2.5 (Microsoft ActiveX Data Objects 2.5).
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
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Dim A As ADODB.Stream Set A = New ADODB.Stream 'open the adodb filestream and save the file locally so we can check its file size then close the adodb filestream object A.Type = adTypeBinary A.Open A.Write XMLHTTPOBJECT.responseBody A.SaveToFile App.Path & "\temp.jpg", adSaveCreateOverWrite A.Close 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
![]() |
Similar Threads
- VBA - Text search within cells (Visual Basic 4 / 5 / 6)
- simple sql query (PHP)
- SQL/XML Query (XML, XSLT and XPATH)
- pagination and search (PHP)
- search results question (PHP)
- SQL slow in Domain Control (MS SQL)
- Beginner: Insert, Update, Delete & Search records from/to sql database (ASP.NET)
- Tutorial: Search a Database (ASP)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: Can someone help me solve this visual basic 6.0 / SQL statement error I am getting?
- Next Thread: Simple Excel Macro (VBA)
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age application basic beginner birth bmp calculator cd cells.find click client code college component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report save search sendbyte sites sort sql sql2008 sqlserver subroutine tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows





