tags:

views:

42

answers:

3

Hi:

I am spreading my wings into ODBC but need a kick-start. I have the SQL for the query and have ODBC installed (it works in Excel; that's how I got the SQL for the query). I need to know how to connect to the database from Access and pull the data into my table. Can someone please help with that?

Thank you,

Dave

A: 

Do you wish to use Excel data in Access? If so, simply link the spreadsheet (External Data).

EDIT
You can also link tables from other Access databases to easily create queries in the Query Design Window.

DAO is native for Access, here are a few notes:

Dim db As Database
Dim rs As DAO.Recordset

Set db = OpenCurrentDatabase("c:\docs\MyDb.mdb")
Set rs= db.OpenRecordset("Select Field From Table")

db.Execute "Update Table Set Field=2", dbFailOnError
Remou
I would prefer to just set up the query in Access. I need to compare the data to other data to make specialized reports. I want to skip the Excel step if possible.
David Glick
A: 

Is your Access file your database or do you want to query another database from Access?

Morten Anderson
The Access file is my database; the database I am querying is not. It is a homegrown database for my company.
David Glick
You should link the tables from your company database into Access. Then you will be able to query them from Access.this link might help you - > http://www.techonthenet.com/access/tables/link_table2007.php
Morten Anderson
Unfortunately I don't have direct access to the tables - I would only have access to them through the database connection. I can't see them on the company network.
David Glick
"through the database connection" -- meaningless phrase. Please explain what you mean by it.
David-W-Fenton
A: 

I don't have MSAccess installed on this machine, so I might have the menu names incorrect.

If I understand correctly you're just trying to get MSAccess to connect to an ODBC database.

Go to the Main menu. Select "File"/"External Data"/"Link" ...

A wizard will step you through the connection set-up and show you the tables available in the database you're connecting to.

Once you've selected all the tables you want to work with, Access imports the definitions and they behave mostly like the local tables.

also see

http://www.aspfree.com/c/a/Microsoft-Access/Importing-Data-into-MS-Access-with-ODBC/1/

Loopo