Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 18th, 2004, 01:20 PM
Registered User
 
Join Date: Apr 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to do CreateQueryDef in ADO?

How do I convert Following DAO code to ADO?

Set qdf = db.CreateQueryDef("Sales Representatives", strSQL)

I allready have a working ADO db connection object.
 
Old April 25th, 2004, 11:24 PM
Authorized User
 
Join Date: Mar 2004
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Dim cmdNew As ADODB.Command

    Set cmdNew = New ADODB.Command
    Set cmdNew.ActiveConnection = CurrentProject.Connection
    cmdNew.CommandText = strSQL
    cmdNew.Execute

    Set cmdNew = Nothing

strSQL might be something like this = "CREATE VIEW titles_view AS SELECT title, type, price, pubdate FROM titles"

Hope this helps.
-Chris
 
Old April 26th, 2004, 12:13 AM
Registered User
 
Join Date: Apr 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks I will check that one out. :)






Similar Threads
Thread Thread Starter Forum Replies Last Post
ADO??? monabaumgartel BOOK: Beginning Access 2003 VBA 1 August 7th, 2007 05:44 PM
Difference between ADO and ADO.NET rakeshclose2u ADO.NET 2 April 23rd, 2007 03:57 AM
ADO ProudToBeMuslim VB Databases Basics 6 January 30th, 2005 11:23 AM
ADO AND ADO.NET royalsurej ADO.NET 1 November 8th, 2004 08:28 AM
ADO could ADO counot find the specified provider. Rob Collie Classic ASP Databases 2 June 9th, 2003 04:12 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.