Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi, I would like to realize with Excel by DAO or ADO two things: The available tables of Excel should be updated by the tables i Access. Best of all simply overwrite. Per table: Either an available line should be updated by changes in Excel i Access, or a new line be added. More should not happen, actually. I hope that there is for this an eas and quick solution. Unfortunately, I cannot handle yet with ADO or DAO. What is better ? Who could help me there? Many thanks already beforehand Walke -- walker00 ----------------------------------------------------------------------- walker002's Profile: http://www.excelforum.com/member.php...fo&userid=2591 View this thread: http://www.excelforum.com/showthread.php?threadid=39413 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Walker,
With ADO, You can test the following. Supposing you have Payroll in col A, named myrange and Status in column B 'First make a reference via Tool/References .... To Microsoft ActiveX Data Objects 2.x Sub test() Dim connMdb As ADODB.Connection Dim recMdb As ADODB.Recordset Dim strStatus As String Set connMdb = New ADODB.Connection Set recMdb = New ADODB.Recordset "open a connection to the DB connMdb.Open "Provider= Microsoft.Jet.OLEDB.4.0;" & "Data Source = " & ThisWorkbook.Path & "\myDB.mdb;" For Each cl In Range("MyRange") 'open the recordset corresponding to the payroll recMdb.Open "Select Payroll, Status from STAFF ;", connMdb, adOpenForwardOnly, adLockOptimistic If recMdb.EOF = False Then strStatus = recMdb.Fields("Status").Value If cl.Offset(0, 1) < strStatus Then Debug.Print recMdb.Fields("Payroll").Value & " " & recMdb.Fields("Status").Value recMdb Else : debug.print " No data for " & cl.value End If recMdb.Close Next cl connMdb.Close Set recMdb = Nothing Set connMdb = Nothing End Sub Regards Jean-Yves "walker002" wrote in message ... Hi, I would like to realize with Excel by DAO or ADO two things: The available tables of Excel should be updated by the tables in Access. Best of all simply overwrite. Per table: Either an available line should be updated by changes in Excel in Access, or a new line be added. More should not happen, actually. I hope that there is for this an easy and quick solution. Unfortunately, I cannot handle yet with ADO or DAO. What is better ? Who could help me there? Many thanks already beforehand Walker -- walker002 ------------------------------------------------------------------------ walker002's Profile: http://www.excelforum.com/member.php...o&userid=25917 View this thread: http://www.excelforum.com/showthread...hreadid=394137 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro to update a column in a work based on another work sheet | New Users to Excel | |||
how can i automatically generate work order numbers from work orde | Excel Discussion (Misc queries) | |||
flash object dont work in my excel work sheet | Excel Discussion (Misc queries) | |||
Counting dates in multiple work sheets and work books | Excel Discussion (Misc queries) | |||
Is there away to keep "auto save" from jumping to the first work sheet in the work book? | New Users to Excel |