PC Review


Reply
Thread Tools Rate Thread

ADODB: duplicates -problem

 
 
Adax
Guest
Posts: n/a
 
      7th Oct 2009
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!

 
Reply With Quote
 
 
 
 
dan dungan
Guest
Posts: n/a
 
      7th Oct 2009
Hi Adax

Are you coding in Excel or Access?

Dan
 
Reply With Quote
 
Adax
Guest
Posts: n/a
 
      7th Oct 2009
Uzytkownik "dan dungan" <(E-Mail Removed)> napisal w wiadomosci
news:2279f8bd-9e5d-4bb5-8ba2-(E-Mail Removed)...
> Hi Adax
> Are you coding in Excel or Access?
> Dan


In Excel VBA....
 
Reply With Quote
 
Adax
Guest
Posts: n/a
 
      8th Oct 2009
Uzytkownik "dan dungan" <(E-Mail Removed)> napisal w wiadomosci
news:2279f8bd-9e5d-4bb5-8ba2-(E-Mail Removed)...
> 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 With Quote
 
Patrick Molloy
Guest
Posts: n/a
 
      8th Oct 2009
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" <(E-Mail Removed)> napisal w wiadomosci
> news:2279f8bd-9e5d-4bb5-8ba2-(E-Mail Removed)...
> > 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 With Quote
 
Adax
Guest
Posts: n/a
 
      8th Oct 2009
Użytkownik "Patrick Molloy" <(E-Mail Removed)>
napisał w wiadomości
news:FB3E41AB-6103-47EA-9488-(E-Mail Removed)...
> 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" <(E-Mail Removed)> napisal w wiadomosci
>> news:2279f8bd-9e5d-4bb5-8ba2-(E-Mail Removed)...
>>> 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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Equivalent ADODB.Connector and ADODB.Recordset in VB.NET Marty Microsoft Dot NET 3 25th Sep 2004 10:36 PM
Equivalent ADODB.Connector and ADODB.Recordset in VB.NET Marty Microsoft VB .NET 3 25th Sep 2004 10:36 PM
Re: URGENT HELP ADODB VbScript vs ADODB.ConnectionClass() C# Cowboy \(Gregory A. Beamer\) [MVP] Microsoft ADO .NET 1 29th Jul 2004 02:11 PM
Re: URGENT HELP ADODB VbScript vs ADODB.ConnectionClass() C# Lucas Tam Microsoft ADO .NET 0 29th Jul 2004 04:34 AM
URGENT HELP ADODB VbScript vs ADODB.ConnectionClass() C# =?Utf-8?B?U2lsdmlhIEJydW5ldCBKb25lcw==?= Microsoft Dot NET Framework 0 28th Jul 2004 07:59 PM


Features
 

Advertising
 

Newsgroups
 


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