Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3337858
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T00:18:13+00:00 2026-05-18T00:18:13+00:00

So lets say I have some code like below to pull data from another

  • 0

So lets say I have some code like below to pull data from another access file:

Sub ADO_Recordset_OpenTable()
Dim rs As ADODB.Recordset
Dim cn As ADODB.Connection
Dim MyPath As String
MyPath = CurrentProject.Path

Set cn = New ADODB.Connection     
cn.Provider = "Microsoft Jet 4.0 OLE DB Provider"

cn.ConnectionString = "Data Source=C:\Users\Justin\Desktop\ExampleFile.mdb"
cn.Open

Set rs = New ADODB.Recordset
rs.Open "Schedule", cn, adOpenDynamic, adLockReadOnly, adCmdTable

' I would like to at this point build a table within the currentdb file 
'  with the data in the recordset. Either some kind of create table or
'  SQL INSERT?? Just trying to learn how to work with the data set

So within the example are my comments. Basically would like to know how to create a table out of the data contained with the recordset. I guess creating a tabledef? But this is DAO right? and I couldn’t really use both DAO and ADO together in a routine right?

Thanks
Justin

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T00:18:14+00:00Added an answer on May 18, 2026 at 12:18 am

    You can use both ADO and DAO for different objects within the same procedure.

    You could create a DAO.TableDef and examine the recordset’s Fields collection, creating new TableDef fields matching each rs.Fields(i).Name and rs.Fields(i).Type

    Once you have created the table structure (TableDef), you can loop through the recordset rows to build and execute INSERT statements to store the row values in your new table.

    But that seems like waaaay too much work to me. I like Raj’s SELECT INTO suggestion better. However, since you already know the table name and path to your MDB, I would reach first for DoCmd.TransferDatabase, and leave ADO only for tasks DAO can’t do at all or can’t do as conveniently as ADO.

    Finally, if your primary interest on this one is exploring possibilities, take a look at the recordset’s Save method. You could save with adPersistXML, then import the saved XML as a new table in your current db. See Save Method (ADO)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Lets say i have some code to iterate through an XML file recursively like
Let's say I have some code (using CherryPy) that looks like this: import cherrypy
Lets say I have multiple commands like 5000 which updates some column and row
Lets say i have a piece of code like this: test pattern | pattern
lets say i have an xml file path.xml that goes like this: <paths> <path
Lets say we have a native library that works with data like this: double
In my code, let's say I have the PaintObject(Graphics g) . In some other
Lets say we have some basic AR model. class User < ActiveRecord::Base attr_accessible :firstname,
Lets say I have one row with three columns - some buttons on left
Lets say I have a simple 1D array with 10-20 entries. Some will be

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.