How to create an QueryDef/TableDef Object for Access2000 database through VB with ADO connection...


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: How to create an QueryDef/TableDef Object for Access2000 database through VB with ADO connection...

  1. #1
    karthikeyan Guest

    How to create an QueryDef/TableDef Object for Access2000 database through VB with ADO connection...


    Hello to All...
    How to create an QueryDef Object for Access2000
    database through VB with ADO connection...

    actually my problem is i was converting a project with
    SQL server database to access 2000 database..in which
    i have got a big query in which inner join they have
    written a select statement ...and access doesnt
    support such formats.. i was trying to create a
    QUERYDEF/TABLEDEF object with ADO connection and use
    that query object in my innerjoin query...
    expecting
    karthik.P

  2. #2
    Paul Clement Guest

    Re: How to create an QueryDef/TableDef Object for Access2000 database through VB with ADO connection

    On 17 Nov 2002 01:09:03 -0800, "karthikeyan" <am_karthik@yahoo.com> wrote:


    Hello to All...
    How to create an QueryDef Object for Access2000
    database through VB with ADO connection...

    actually my problem is i was converting a project with
    SQL server database to access 2000 database..in which
    i have got a big query in which inner join they have
    written a select statement ...and access doesnt
    support such formats.. i was trying to create a
    QUERYDEF/TABLEDEF object with ADO connection and use
    that query object in my innerjoin query...
    expecting
    karthik.P

    You can use ADOX (Microsoft ADO Ext 2.x for DDL and Security) to do this:

    Function CreateQueryDefADOX()

    Dim cat As New ADOX.Catalog
    Dim cnn As New ADODB.Connection
    Dim cmd As New ADODB.Command

    cnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
    "Data Source=d:\My Documents\db1.mdb;" & _
    "Jet OLEDB:Engine Type=4;"

    Set cat.ActiveConnection = cnn
    cmd.CommandText = "Select * from Table1"
    cat.Views.Append "qsel_Table1", cmd

    cnn.Close
    Set cat = Nothing
    Set cnn = Nothing

    End Function


    Paul ~~~ pclement@ameritech.net
    Microsoft MVP (Visual Basic)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center