ADODB: duplicates -problem
Hello, I have problem with auto-separating duplicates records by PrimaryKey
i Access table. Dim conn As ADODB.Connection conn.Execute "INSERT INTO Tabele1.....", p1, p2 Is it possible set the p1 & p2 parameters for this? I want to have similary solution, that in DoCmd.RunSQL, where is auto-separating duplicates records: DoCmd.SetWarnings False DoCmd.RunSQL "INSERT INTO Tabele1.....", -1 DoCmd.SetWarnings True Help me, please, Thanks! |
ADODB: duplicates -problem
Hi Adax
Are you coding in Excel or Access? Dan |
ADODB: duplicates -problem
Uzytkownik "dan dungan" napisal w wiadomosci
... Hi Adax Are you coding in Excel or Access? Dan In Excel VBA.... |
ADODB: duplicates -problem
Uzytkownik "dan dungan" napisal w wiadomosci
... Hi Adax Are you coding in Excel or Access? Dan I have advanced calculation in VBA in Excel and from Excel I have resalt: matrix: 100 000 x 20. Unfortunately some from 100 000 records are duplicate (each field, without Index certanly) and I'm looking for quick solution, that help me separate theese duplicates. Could You help me find the good solution for this problem? Thanks! |
ADODB: duplicates -problem
I'm a little confused. You started with an INSERY statement m, but now you
want to read data? your insert should be something like INSERT INTO table ([field1],[field2]) values ( 'a','b') i guess 'a' and 'b' are the params so sSQL= "INSERT INTO table ([field1],[field2]) values ( '%a%','%b%')" sSQL = REPLACE(sSQL,"%a%", p1) sSQL = REPLACE(sSQL,"%b%", p2) your 2nd question is reading data but avoiding dulicates. Have you tried using DISTINCT SELECT DISTINCT [field] FROM [table] "Adax" wrote: Uzytkownik "dan dungan" napisal w wiadomosci ... Hi Adax Are you coding in Excel or Access? Dan I have advanced calculation in VBA in Excel and from Excel I have resalt: matrix: 100 000 x 20. Unfortunately some from 100 000 records are duplicate (each field, without Index certanly) and I'm looking for quick solution, that help me separate theese duplicates. Could You help me find the good solution for this problem? Thanks! |
ADODB: duplicates -problem
Użytkownik "Patrick Molloy"
napisał w wiadomości ... I'm a little confused. You started with an INSERY statement m, but now you want to read data? Unfortunately, I can't change the way of storage data in matrix 100 000 x 20 and now I'm only looking for the way duplicates separate. Dim conn As ADODB.Connection conn.Execute "INSERT INTO Tabele1.....", p1, p2 p1, p2 are connection parameters! This DoCmd.RunSQL "INSERT INTO (in Access) is the best and terfore I'm looking similary way in ADODB.Connection DoCmd.SetWarnings False DoCmd.RunSQL "INSERT INTO Tabele1.....", -1 DoCmd.SetWarnings True your insert should be something like INSERT INTO table ([field1],[field2]) values ( 'a','b') i guess 'a' and 'b' are the params so sSQL= "INSERT INTO table ([field1],[field2]) values ( '%a%','%b%')" sSQL = REPLACE(sSQL,"%a%", p1) sSQL = REPLACE(sSQL,"%b%", p2) your 2nd question is reading data but avoiding dulicates. Have you tried using DISTINCT SELECT DISTINCT [field] FROM [table] Yes, I have tried. Unfortunately one of field is different (key) and for this reason I can't make simple SELECT DISTINCT.... Probably I have to make subselect, but the most importest is short time, because I have about 100 000 records... Thanks! "Adax" wrote: Uzytkownik "dan dungan" napisal w wiadomosci ... Hi Adax Are you coding in Excel or Access? Dan I have advanced calculation in VBA in Excel and from Excel I have resalt: matrix: 100 000 x 20. Unfortunately some from 100 000 records are duplicate (each field, without Index certanly) and I'm looking for quick solution, that help me separate theese duplicates. Could You help me find the good solution for this problem? Thanks! |
All times are GMT +1. The time now is 05:21 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com