Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Is there a way to use sql with DAO?
Message
 
À
11/09/2001 18:42:48
Information générale
Forum:
Visual Basic
Catégorie:
Contrôles ActiveX
Divers
Thread ID:
00555307
Message ID:
00555476
Vues:
14
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform