Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is there a way to use sql with DAO?
Message
 
To
11/09/2001 18:42:48
General information
Forum:
Visual Basic
Category:
ActiveX controls
Miscellaneous
Thread ID:
00555307
Message ID:
00555476
Views:
15
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform