Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default 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!

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 411
Default ADODB: duplicates -problem

Hi Adax

Are you coding in Excel or Access?

Dan
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default ADODB: duplicates -problem

Uzytkownik "dan dungan" napisal w wiadomosci
...
Hi Adax
Are you coding in Excel or Access?
Dan


In Excel VBA....
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default 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!

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default 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!




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default 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!



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
ADODB Connection Problem spardey Excel Programming 5 December 3rd 05 11:00 PM
ADODB Connection Problem alpder Excel Programming 3 November 4th 05 09:28 PM
problem using isnull() to check a value in ADODB.Recordset tilmP Excel Programming 0 January 18th 05 07:42 AM
Access to Excel Automation ADODB Problem Matt Slattery Excel Programming 2 September 29th 04 12:59 PM
ADODB Recordset problem Stefen Percoco Excel Programming 2 July 26th 04 06:31 PM


All times are GMT +1. The time now is 05:39 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"