Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Jamie Collins Wrote: sal21 wrote ... UHM... for me this is Arabic language It's actually the SQL language. Do you like to modify my script Erm, OK then. The following is untested so ensure you have copies o your files: Sub ADO_PAGATI() ' exports data new rows from the active worksheet ' to a table in an Access database Dim cn As ADODB.Connection ' connect to the Access database Set cn = New ADODB.Connection cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _ "Data Source=D:\PROVA\PROVA.MDB;" ' Add new rows Dim lngRowsAffected As Long cn.Execute "INSERT INTO TOTALE" & _ " SELECT T1.[DATA CONT#], T1.DIP, T1.COD, T1.[C/C]," & _ "T1.NOMINATIVO, T1.[CAUS#], T1.[IMP# DARE]," & _ "T1.[IMP# AVERE], T1.[VAL#], T1.[SPORT# MITT#]," & _ "T1.[ANOM#], T1.[DESCRIZIONE OPERAZIONE]," & _ "T1.[INDICE (C#R#O#)], T1.ABI, T1.CAB," & _ "T1.[PAG#/IMP#], T1.[NR# ASS#], T1.MT, T1.SERVIZIO," & _ "T1.[NOTE B#O#U#], T1.SPESE, T1.[DATA ATTIVITA']," & _ "T1.COD1 FROM TOTALE AS T1 LEFT JOIN" & _ " [Excel 8.0;HDR=YES;Database=C:\MyWorkbook.xls;]" & _ ".[L0785_TOTALE$A6:W65535]" & _ " AS T2 ON T1.SERVIZIO = T2.SERVIZIO" & _ " WHERE T2.SERVIZIO IS NULL", lngRowsAffected cn.Close MsgBox lngRowsAffected & " added to database." End Sub Jamie. -- send me ths cript ![]() ![]() i am "out of memory -- sal2 ----------------------------------------------------------------------- sal21's Profile: http://www.excelforum.com/member.php...nfo&userid=204 View this thread: http://www.excelforum.com/showthread.php?threadid=27654 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
On Duplicate, update record | Excel Discussion (Misc queries) | |||
How do I remove duplicate in a column but keep the record of the f | New Users to Excel | |||
Need to color 1 record of each set of Duplicate Records | Excel Worksheet Functions | |||
Duplicate Record.... | Excel Programming | |||
Duplicate Record.... | Excel Programming |