|
-
Jun 15th, 2000, 03:42 PM
#1
Thread Starter
New Member
I have this ado data control and a datagrid
The SQL Statement is something like this
SQLString = "SELECT * FROM Main WHERE Name LIKE ('*John*')"
when the display button is clicked, the following statements are executed,
frmDBGrid.Adodc1.CommandType = adCmdText
frmDBGrid.Adodc1.RecordSource = SQLString
frmDBGrid.Adodc1.Refresh
frmDBGrid.DataGrid1.SetFocus
But it seems like the ado data control has no record in it, when there should be.
-
Jun 15th, 2000, 03:54 PM
#2
PowerPoster
Your SQl should look like this:
Code:
SQLString = "SELECT * FROM Main WHERE Name LIKE '*John*';"
and it will search for all record that have any character either before or after John.
-
Jun 15th, 2000, 04:17 PM
#3
Thread Starter
New Member
I've tried the following SQL statement..
but it's still not working.
the ado data control is greyed out. (meaning no recordset?)
-
Jun 17th, 2000, 03:26 AM
#4
PowerPoster
Just make sure there is a data with "John" in the Name field. If yes, then try to change the field name Name to other like MyName. Because i affraid it conflict with the system reserve word.
-
Jun 17th, 2000, 09:34 PM
#5
Thread Starter
New Member
heh
thanks Chris and others who have helped me out..
btw, I can't remember who's that..
but someone posted the solution on the forum..
i should have change the wildcard * to %
as in "Name LIKE ('*John*')" to "Name LIKE ('%John%')"
think maybe it's becoz I used adodc ...
if i've used coding instead... think * will work as well..
coz it actually worked in the first place...
anyway, thanks..
btw, how do I close a thread?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|