Is it possible to use Access data w/o importing it?

ricky252525

New Member
Joined
Aug 24, 2010
Messages
2
Hi folks-- Just wondering if there is any way that I can use data from an Access table in my Excel functions without importing the Access data into the wookbook.

I set up a connection to the Access table that I need, but don't know what the syntax would be to reference those fields in functions in my Excel sheet (or if it's even possible).

My problem is that the Access table is large and I want to keep the size of the Excel workbook small.

Thanks!
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
You can access the data via ADO code...

Code:
Public Sub GetRstData()
Dim con As ADODB.Connection
Dim rs As ADODB.Recordset
Dim DB
Dim vProvid
Set con = New ADODB.Connection
Set rs = New ADODB.Recordset
 
 uid = "ShanDonovan"
 pwd = ""
 DB = "C:\Generic104J.mdb"
 vProvid = "Microsoft.Jet.OLEDB.4.0"     '  "SQLOLEDB"
 
 'con.Open "Provider=SQLOLEDB; Server=db.someserver.uk; Database=DB; User ID=" & uid & "; Password=" & pwd & ";"
 'con.Provider = "Microsoft.Jet.OLEDB.4.0"
 '"Provider=" & vProvid; Server=db.someserver.uk; Database=DB; User ID=" & uid & "; Password=" & pwd & ";"
  
With con
    .Provider = "Microsoft.Jet.OLEDB.4.0"
    .Properties("User ID").Value = uid
    .Properties("Password").Value = pwd
    
    .Open "Data Source=" & DB & ";Jet OLEDB:System Database=\\gad.intra.net\amer\UMA\Secured All UMA.mdw"
End With
 
Set rs = con.Execute("qsNames_simps")
'now access the records
'copy data from recordset
'ActiveWorkbook.Worksheets("Sheet1").Range("A1").CopyFromRecordset rs
rs.Close
con.Close
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,849
Members
452,361
Latest member
d3ad3y3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top