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: 17
Default Store Data in Access

Hello,

I have the following code that pulls data directly from a sql server into a
spreadsheet. Now, I'd like to modify the code so I can store the data into an
Access table/database (still from Excel). I want to create a new Access
database everytime I run the code. I am not too familiar with Access objects
in Excel, so any helps will be greatly appreciated. Thanks very much in
advance.

Public Sub updateLoanCharacteristics()
Dim strQuery As String

Set conSQL = New ADODB.Connection
Set rsQuery = New ADODB.Recordset

conSQL.Open "Provider=MSDASQL;DSN=PM_SQL_SERVER_ARCHIVE;"

strQuery="Select * from tblData"

With rsQuery
.ActiveConnection = conSQL
.Open strQuery
ActiveWorkbook.ActiveSheet.Range("AU3").CopyFromRe cordset rsQuery
.Close
End With

conSQL.Close

Set conSQL = Nothing
Set rsQuery = Nothing

End Sub


Regards,
Adrian T

 
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
Excel user enter a store # to query Access data base liem Excel Discussion (Misc queries) 0 January 16th 10 03:45 AM
store inventory sheet(ex:sports equipment store) vardan Excel Worksheet Functions 1 October 11th 06 12:51 AM
Store Excel Results in Access ernie Excel Discussion (Misc queries) 4 March 9th 06 03:37 PM
Store sheet names in Access Muriel Excel Programming 2 January 3rd 06 05:23 AM
Access data base is able to store any number of records clearcell Excel Worksheet Functions 0 November 8th 05 08:45 PM


All times are GMT +1. The time now is 04:57 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"