473,385 Members | 1,472 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

how to extract data from first access table and use it another vba application

i want to extract data from 1st access table and use that data in another access vba application .


how to do data extraction????
please sujjest me some sample vba code for data extraction
Aug 7 '12 #1
5 2401
Rabbit
12,516 Expert Mod 8TB
Is this a VB or VBA question? They are not the same and you are probably posting in the wrong forum.
Aug 7 '12 #2
kadghar
1,295 Expert 1GB
Of course its VBA, Rabbit.

Anyway, if your Access DB is an MDB, then you can do this:
1) Make sure you add this reference to your VBA project:
Microsoft DAO Object Library.

2) Use a DataBase object and a Recordset; something like:
Expand|Select|Wrap|Line Numbers
  1. Dim DBobj As Database
  2. Dim RSet As Recordset
  3. Set DBobj = DBEngine.Workspaces(0).OpenDatabase(yourfile.mdb)
  4. Set RSet = DBobj.OpenRecordset("SELECT * FROM table WHERE...")
  5. While not RSet.EOF
  6.     MsgBox RSet("anyField")
  7.     'do something else
  8.     RSet.MoveNext
  9. Wend
  10.  
Aug 8 '12 #3
hello i am using access 2007 accdb database.

what will be same code for access 2007 accdb.
Aug 8 '12 #4
kadghar
1,295 Expert 1GB
Mmm, I'm not sure; but you can always save as MDB
Aug 8 '12 #5
zmbd
5,501 Expert Mod 4TB
Yes the code will be basiclly the same...
make sure to use the correct file name.
-z
Aug 8 '12 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Fred | last post by:
Hi. How do I import while mapping an excel table to an access table please??? I've searched around and all I can find is a software product or code that does the same thing as the access...
2
by: SenseForAll | last post by:
First please note I am a novice at VBA and not even that experienced with DAO/ADO and MS-SQL. Any assistance is appreciated. That said... I have an application written in Access w/ VBA. I need to...
3
by: Mads Petersen | last post by:
I'm stuck in this code. Hope you can and will help me. I launch it from excel. I have made the following code work, but not as i whant. I need the ranges to be working with something like xlDown....
2
by: VMI | last post by:
I have a datatable with emplcodes and I need to extract, from my Access table, all records that contain an emplcode included in my datatable. In other words, I need to do a query that accesses a...
12
by: VMI | last post by:
For some reason, the process of retrieving data (about 20 records) from an Access table that has 400K records to a dataTable is taking over 3 mins. to complete. Below is my code to connect to the...
12
by: rdemyan via AccessMonster.com | last post by:
I'm having a complicated linking problem. Before I get into the particulars, I'd like to know how Access links to the back-end file at startup, AFTER I've distributed my application to the client....
0
by: =?Utf-8?B?Q2hyaXM=?= | last post by:
The following code geenrated by C# automatically is supposed to save changes on a form with a dataset to the underlying table. For some reason it will not work with Access or SQL. Any ideas why? I...
2
by: Bauhaus | last post by:
I have a form with a button and if you click the button, a list of invoices are generated and saved in the table 'Invoice'. Problem is, the data isnt saved :( Here's my code: Private Sub...
5
by: abhi3211 | last post by:
i am using java inside java script page. in that page i want to use two dropdown list. in first dropdown list i am getting data from ms-access database. in second dropdown list i want to get data...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.