Click here to Skip to main content
15,902,938 members
Home / Discussions / Database
   

Database

 
GeneralSQL query Pin
John-theKing16-Apr-03 2:02
John-theKing16-Apr-03 2:02 
GeneralRe: SQL query Pin
John Honan16-Apr-03 3:55
John Honan16-Apr-03 3:55 
GeneralRe: SQL query Pin
John-thKing16-Apr-03 4:48
sussJohn-thKing16-Apr-03 4:48 
GeneralRe: SQL query Pin
John Honan16-Apr-03 4:54
John Honan16-Apr-03 4:54 
GeneralRe: SQL query Pin
greg lynch _nj_17-Apr-03 3:07
greg lynch _nj_17-Apr-03 3:07 
GeneralRe: SQL query Pin
si_6917-Apr-03 5:08
si_6917-Apr-03 5:08 
GeneralDummies guide to SQL Pin
Michael P Butler15-Apr-03 23:14
Michael P Butler15-Apr-03 23:14 
GeneralRe: Dummies guide to SQL Pin
perlmunger16-Apr-03 5:44
perlmunger16-Apr-03 5:44 
Generalfield=field+', ' in SQL Pin
stefan b15-Apr-03 23:08
stefan b15-Apr-03 23:08 
GeneralRe: field=field+', ' in SQL Pin
Jeremy Oldham16-Apr-03 2:29
Jeremy Oldham16-Apr-03 2:29 
GeneralRe: field=field+', ' in SQL Pin
stefan b16-Apr-03 18:47
stefan b16-Apr-03 18:47 
GeneralSQL 2000 Backup to SQL 7 Backup Pin
Paul Watson15-Apr-03 22:10
sitebuilderPaul Watson15-Apr-03 22:10 
GeneralRe: SQL 2000 Backup to SQL 7 Backup Pin
Paul Watson15-Apr-03 22:57
sitebuilderPaul Watson15-Apr-03 22:57 
GeneralUpdating Multiple records through Storedprocedure and getting event notifications Pin
Mairaj Zeb15-Apr-03 20:42
Mairaj Zeb15-Apr-03 20:42 
Generaldata mining Pin
devvvy15-Apr-03 16:58
devvvy15-Apr-03 16:58 
GeneralSQL data to create directories Pin
gman4415-Apr-03 4:41
gman4415-Apr-03 4:41 
GeneralRe: SQL data to create directories Pin
Richard Deeming15-Apr-03 6:51
mveRichard Deeming15-Apr-03 6:51 
GeneralRe: SQL data to create directories Pin
si_6917-Apr-03 5:46
si_6917-Apr-03 5:46 
Generalreading a single record from SQL Pin
gollnick15-Apr-03 0:47
gollnick15-Apr-03 0:47 
GeneralRe: reading a single record from SQL Pin
perlmunger16-Apr-03 5:39
perlmunger16-Apr-03 5:39 
QuestionMS Access & BatchUpdate throw ADO ? Pin
rosen14-Apr-03 3:50
rosen14-Apr-03 3:50 
Generalsearch syntax problem Pin
ylaine14-Apr-03 1:09
ylaine14-Apr-03 1:09 
i am trying to develop a search function. user can search by entering a few types of information. the search will display all the results matching the words entered by the user.
the problem is:
if i enter the barcode number only, all the documents are displayed. and if i leave the txtBarCode blank and enter description, no document is displayed, even when the document table in my database contains the word. why is this happening?

<div align="left"><font face="Arial, Helvetica, sans-serif" size="2">Bar Code Number</font></div>
<td width="56%"><asp:textbox id="txtBarCode" runat="server" TextMode="SingleLine"></asp:textbox></td>

<td height="25"><font face="Arial, Helvetica, sans-serif" size="2">Description</font>
</td>
<td><asp:textbox id="txtDesc" runat="server" TextMode="SingleLine"></asp:textbox></td>

aspx.vb
-------
Dim strConn As String = "Provider=SQLOLEDB..."
Dim objConn As New OleDb.OleDbConnection(strConn)
Dim searchStr2, criteriaArray, queryCriteria,i, query1, rst1,rst2 objConn.Open()
searchStr2 = fp.Searchsyntax
criteriaArray = Split(searchStr2, ",")
queryCriteria = " [tblDocument].BarCodeNo IS NOT NULL"
For i = 1 To UBound(criteriaArray)
queryCriteria = queryCriteria & " AND "
If criteriaArray(i) = fp.Barcode Then
queryCriteria = queryCriteria & "[tblDocument]." & criteriaArray(i) & " LIKE '%" & fp.Barcode & "%'"
ElseIf criteriaArray(i) = fp.Desc Then
queryCriteria = queryCriteria & "[tblDocument]." & criteriaArray(i) & " LIKE '%" & fp.Majordesc & "%'"
End If
Next

query1 = "SELECT * FROM [tblDocument] WHERE " & queryCriteria & " ORDER BY [tblDocument].BarCodeNo"



Laine
GeneralDataViewManager, Rowfilters and Child Filtering Pin
xpurt14-Apr-03 0:44
xpurt14-Apr-03 0:44 
GeneralDynamic SQL with in a stored procedure Pin
Venkatraman13-Apr-03 17:56
Venkatraman13-Apr-03 17:56 
GeneralPersonal Sql Server Pin
Steve McLenithan13-Apr-03 9:14
Steve McLenithan13-Apr-03 9:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.