wrong SQL syntax or ...? 
Author Message
 wrong SQL syntax or ...?

Hallo !

I want to fiter data on DBGrid. I  have this code in click() event of
cmdbutton on the same form where dbgrid is located :

Private Sub cmdfilter_click()
Data1.RecordSource "Select* from [modems] Where [type_modem]="ASMi 450"
Order by [type_modem]"
End Sub

It doesn't work. I don't know why.

....But when I have this SQL command written in RecordSource property of
DataControl (in time of creating of application), after start the DBGrid
show me what I want ( Just the records which have the "ASMi 450" value in
the "type_modem" - column of recordset.

My question is : Why doesn't it work under the click() procedure of button ?

Thank u for your answers !!!

MarianF



Sat, 19 Jul 2003 01:09:41 GMT
 wrong SQL syntax or ...?

Maybe
data1.recordsource "SELECT * FROM modems WHERE type_modem='ASMi450' ORDER BY
type_modem"
or
data1.recordsource "SELECT * FROM [modems] WHERE [type_modem]='ASMi450'
ORDER BY type_modem"
-------
degojs


Quote:
> Hallo !

> I want to fiter data on DBGrid. I  have this code in click() event of
> cmdbutton on the same form where dbgrid is located :

> Private Sub cmdfilter_click()
> Data1.RecordSource "Select* from [modems] Where [type_modem]="ASMi 450"
> Order by [type_modem]"
> End Sub

> It doesn't work. I don't know why.

> ....But when I have this SQL command written in RecordSource property of
> DataControl (in time of creating of application), after start the DBGrid
> show me what I want ( Just the records which have the "ASMi 450" value in
> the "type_modem" - column of recordset.

> My question is : Why doesn't it work under the click() procedure of button
?

> Thank u for your answers !!!

> MarianF



Fri, 25 Jul 2003 12:48:51 GMT
 
 [ 2 post ] 

 Relevant Pages 

1. Sqlj claims sql syntax wrong

2. What is wrong with my simple SQL syntax?

3. Old Article: Access SQL syntax versus Transact SQL syntax

4. What's wrong with this syntax?

5. what is the wrong in this syntax

6. wrong DAO error: Syntax error in number in query expression

7. Whats wrong with BCP syntax ?

8. Wrong Syntax ??

9. Whats wrong with the syntax ?

10. What is wrong with this LOCATE syntax?

11. What's wrong with this syntax?


 
Powered by phpBB® Forum Software