Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 20
Default Ecell Use of an Access Table information

I have a a table in Access that holds some information that I need to use in
EXcell for the time being. Is it possible to have Excell work directly with
information held in an Access Table. I currently resolve the problem by
exporting the Table to Excell and then using Vlookup to access the data. This
means I have 2 versions of the same data and that is not good. it would be
good to do something like a lookup from within Excell but looking up
information held in an Access Table rather than another Spreadsheet.
Is this possible? Ammending the info in the Access table from within Excell
would be good but not neccessary.
Thanks RayC
  #2   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 10,593
Default Ecell Use of an Access Table information

Here is a starter


Sub GetData()
Const adOpenForwardOnly As Long = 0
Const adLockReadOnly As Long = 1
Const adCmdText As Long = 1
Dim oRS As Object
Dim sConnect As String
Dim sSQL As String
Dim ary

sConnect = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & "c:\bob.mdb"

sSQL = "SELECT * From Contacts"
Set oRS = CreateObject("ADODB.Recordset")
oRS.Open sSQL, sConnect, adOpenForwardOnly, _
adLockReadOnly, adCmdText

' Check to make sure we received data.
If Not oRS.EOF Then
ary = oRS.getrows
MsgBox ary(0, 0) & " " & ary(1, 0) & ", " & ary(2, 0)
Else
MsgBox "No records returned.", vbCritical
End If

oRS.Close
Set oRS = Nothing
End Sub



--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Ray C" wrote in message
...
I have a a table in Access that holds some information that I need to use
in
EXcell for the time being. Is it possible to have Excell work directly
with
information held in an Access Table. I currently resolve the problem by
exporting the Table to Excell and then using Vlookup to access the data.
This
means I have 2 versions of the same data and that is not good. it would be
good to do something like a lookup from within Excell but looking up
information held in an Access Table rather than another Spreadsheet.
Is this possible? Ammending the info in the Access table from within
Excell
would be good but not neccessary.
Thanks RayC



  #3   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 11,123
Default Ecell Use of an Access Table information

Hi Ray

See also
http://www.rondebruin.nl/accessexcel.htm

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Ray C" wrote in message ...
I have a a table in Access that holds some information that I need to use in
EXcell for the time being. Is it possible to have Excell work directly with
information held in an Access Table. I currently resolve the problem by
exporting the Table to Excell and then using Vlookup to access the data. This
means I have 2 versions of the same data and that is not good. it would be
good to do something like a lookup from within Excell but looking up
information held in an Access Table rather than another Spreadsheet.
Is this possible? Ammending the info in the Access table from within Excell
would be good but not neccessary.
Thanks RayC

  #4   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 20
Default Ecell Use of an Access Table information

Thamks Bob, this is great
Regards RayC

"Bob Phillips" wrote:

Here is a starter


Sub GetData()
Const adOpenForwardOnly As Long = 0
Const adLockReadOnly As Long = 1
Const adCmdText As Long = 1
Dim oRS As Object
Dim sConnect As String
Dim sSQL As String
Dim ary

sConnect = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & "c:\bob.mdb"

sSQL = "SELECT * From Contacts"
Set oRS = CreateObject("ADODB.Recordset")
oRS.Open sSQL, sConnect, adOpenForwardOnly, _
adLockReadOnly, adCmdText

' Check to make sure we received data.
If Not oRS.EOF Then
ary = oRS.getrows
MsgBox ary(0, 0) & " " & ary(1, 0) & ", " & ary(2, 0)
Else
MsgBox "No records returned.", vbCritical
End If

oRS.Close
Set oRS = Nothing
End Sub



--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Ray C" wrote in message
...
I have a a table in Access that holds some information that I need to use
in
EXcell for the time being. Is it possible to have Excell work directly
with
information held in an Access Table. I currently resolve the problem by
exporting the Table to Excell and then using Vlookup to access the data.
This
means I have 2 versions of the same data and that is not good. it would be
good to do something like a lookup from within Excell but looking up
information held in an Access Table rather than another Spreadsheet.
Is this possible? Ammending the info in the Access table from within
Excell
would be good but not neccessary.
Thanks RayC




  #5   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 20
Default Ecell Use of an Access Table information

Thanks Ron, this is excelent
RayC

"Ron de Bruin" wrote:

Hi Ray

See also
http://www.rondebruin.nl/accessexcel.htm

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Ray C" wrote in message ...
I have a a table in Access that holds some information that I need to use in
EXcell for the time being. Is it possible to have Excell work directly with
information held in an Access Table. I currently resolve the problem by
exporting the Table to Excell and then using Vlookup to access the data. This
means I have 2 versions of the same data and that is not good. it would be
good to do something like a lookup from within Excell but looking up
information held in an Access Table rather than another Spreadsheet.
Is this possible? Ammending the info in the Access table from within Excell
would be good but not neccessary.
Thanks RayC


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I access customer information easily on XL? HoganD87 Excel Discussion (Misc queries) 1 August 17th 07 02:07 AM
Lookup information in Access Database John Excel Discussion (Misc queries) 3 April 27th 07 03:35 PM
Getting Information from a query in ACCESS Debbie[_2_] Excel Worksheet Functions 2 February 24th 07 01:11 AM
VB Script in Ecell Dennis Evans Excel Worksheet Functions 1 October 12th 05 01:54 PM
Ecell 2000 SP3 holy dog Setting up and Configuration of Excel 4 September 1st 05 01:51 PM


All times are GMT +1. The time now is 11:26 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"