LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 66
Default ADO recordset

With considerable help from this DG, I've written this code that successfully
returns records from an Access db to Excel.

Sub Test()

Dim cn As ADODB.Connection
Dim rec As ADODB.Recordset
Dim nCol As Integer

Set cn = New Connection
Set rec = New Recordset

'Open the connection
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=\\oprdgv1\depart\Finance\" & _
"_Health Solutions Group\Customer\Customer.mdb" & ";"

'Open the recordset
rec.Open "SELECT * FROM tblTESTING" & ";", cn, adOpenForwardOnly,
adLockOptimistic

'Returns recordset to Excel, including the header record
For nCol = 1 To rec.Fields.Count
Sheets("Sheet1").Cells(1, nCol).Value = rec.Fields(nCol - 1).Name
Next nCol
Sheets("Sheet1").Cells(2, 1).CopyFromRecordset rec
Set rec = Nothing
Set cn = Nothing

End Sub

What I REALLY want to do now is use a "virtual recordset" as an argument in
another Excel function. Because the set of data I have exceeds Excels row
limitations, I have the data stored in Access, but need to use that data as
an argument in Excel's LINEST function. How would I proceed with this?
 
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
Recordset Searches James McDowell[_2_] Excel Programming 3 July 11th 06 11:20 PM
How to locate the end of a recordset CLamar Excel Programming 3 June 1st 06 07:16 PM
Need ADO Recordset Help Mr B[_2_] Excel Programming 9 April 21st 06 04:51 PM
Type recordset/recordset? FlaviusFlav[_9_] Excel Programming 4 May 24th 04 12:16 PM
Recordset Stephan Kassanke Excel Programming 0 September 10th 03 04:45 PM


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

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

About Us

"It's about Microsoft Excel"