S
sal21
send me (e-mail address removed) ths criptJamie said:sal21 said: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.
--



i am "out of memory