Help with a weird problem

  • Thread starter Thread starter shula37
  • Start date Start date
S

shula37

Guest
Hiya!

I am having problems with the following query.

SELECT CustomerID, CompanyName FROM Customer WHERE Status="P" AND CompanyName like "a*" ORDER BY CompanyName

This query runs perfectly fine in the query design view. But when I run this query (using ADO) by clicking a button in a form, it returns no results. Does anyone have any clue what's wrong? I have checked the properties of my form and all the controls but they seem to be alright.

I hope someone can help me out with this! I have been racking my brains for two days! :-(

cheers,
shula
 
Hi Shula,

Can you post the code as well, then it might be easier to see what is going on and someone else may help
 
here's my code

'** The query **
strQuery = "SELECT CustomerID, CompanyName FROM Customer WHERE Status='P' AND CompanyName LIKE 'ab*' ORDER BY CompanyName"

'** Initialize connection and recordsest **
Set pCnConn = New ADODB.Connection
Set rs1 = New ADODB.Recordset

'** Open connection **
pCnConn.Open pStrConn

'** Open recordset **
rs1.Open strQuery, pCnConn, adOpenForwardOnly, adLockReadOnly

it seems like a simple query n everything looks alrite. i juz dun know why the results are not out :confused: someone pls help, thanks in advance

cheers,
shula
 

Users who are viewing this thread

Back
Top Bottom