I have a visual basic 2012 Express application that uses an ADODB connection to a DBase database (simple and easy to distribute). I captured the SQL string sent to the connection object using Quickwatch. I pasted the SQL statement directly into an SQL tool (WinSQL). I executed the SQL and it returned no rows which is absolutely correct. However, when the same SQL string is passed to the ADODB connection, 189 rows are returned.
Here is the code the initializes the ADODB connection:
Here is the SQL string being passed:
Here is the SQL string:
The correct results is NO ROWS because all the names in the column VerseText begin with upper case. But, for some reason, the ADODB connection is returning 189 rows which is incorrect.
Does anybody have any ideas what could be going on and how to force the connection to be case sensitive?
Here is the code the initializes the ADODB connection:
Code:
' Define DBase connection
strConn = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\DataStore;Extended Properties=DBASE III"
ConnDBF = New ADODB.Connection
' Open DBase database connection
ConnDBF.Open(strConn)
OK = ConnDBF.State
' Initialize recordset
rstGRK = New ADODB.Recordset
rstGRK.CursorType = ADODB.CursorTypeEnum.adOpenStatic
Here is the SQL string being passed:
Code:
' Get result set
rstGRK.Open(SQLString, ConnDBF)
' Get number of hits
ResultCnt = rstGRK.RecordCount
Here is the SQL string:
Code:
SELECT BKL.BkShtName,
SRC.BookNo,
SRC.ChapNo,
SRC.VerseNo,
SRC.VerseText,
FROM BIENBVS SRC,
BIBKLST BKL
WHERE SRC.BookNo = BKL.BookNumber
AND (SRC.VerseText1 LIKE '%frank jones%'
OR SRC.VerseText2 LIKE '%frank jones%' )
ORDER BY 2, 3, 4
Does anybody have any ideas what could be going on and how to force the connection to be case sensitive?