>im using ADO to connect to a database, but i wanna know if i can use
>DAO with SQL< like:
>dim variable as sring
>variable = "China"
>data1.recordsource = "Select * from Providers where products like variable "
>
>Let me know if is better to use ADO than DAO, since i am using both, but i work better with ADO< talking about SQL Stuff!
>
>GRACIAS MIS AMIGOS DEL FORO DEL HILO UNIVERSAL!
>
>SALUDOS!
Hi,
If you still want to use DAO to run a query the code below may help you:
Dim strVar as String
Dim rst as DAO.Recordset
strVar = "12"
Set rst=CurrentDB.OpenRecordset("Select * From tblMyTable Where MyCriteria=" & strVar & ";",dbOpenDynaset)
HTH
Igor Gelin
Database Developer