Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel user enter a store # to query Access data base | Excel Discussion (Misc queries) | |||
store inventory sheet(ex:sports equipment store) | Excel Worksheet Functions | |||
Store Excel Results in Access | Excel Discussion (Misc queries) | |||
Store sheet names in Access | Excel Programming | |||
Access data base is able to store any number of records | Excel Worksheet Functions |