PC Review


Reply
Thread Tools Rate Thread

Copy tables from Oracle to Access FAST?

 
 
Troy McLure
Guest
Posts: n/a
 
      29th Oct 2005
I have used the code below to copy data from one Access file to another
Access file, and it's seems to be pretty fast. When the source tables
are in Oracle and using an OracleConnection as source, my insertstring
won't work anymore. Will I have to start filling datasets, traverse the
rows and copy each field in for-loops? Won't that be terribly slow? Is
there a faster way?

//Destination Access file exists and has the same tablenames and
fieldnames as the source, so:
OleDbConnection conSrc =
new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;"+
"data source=" + @"c:\source.mdb" );
conSrc.Open();
string insertstring = @"INSERT INTO tablename IN "c:\destination.mdb"
SELECT * FROM tablename";
OleDbCommand cmd = new OleDbCommand(insertString, conSrc);
cmd.ExecuteNonQuery();
 
Reply With Quote
 
 
 
 
Paul Clement
Guest
Posts: n/a
 
      31st Oct 2005
On Sat, 29 Oct 2005 01:39:42 +0200, Troy McLure <(E-Mail Removed)> wrote:

¤ I have used the code below to copy data from one Access file to another
¤ Access file, and it's seems to be pretty fast. When the source tables
¤ are in Oracle and using an OracleConnection as source, my insertstring
¤ won't work anymore. Will I have to start filling datasets, traverse the
¤ rows and copy each field in for-loops? Won't that be terribly slow? Is
¤ there a faster way?
¤
¤ //Destination Access file exists and has the same tablenames and
¤ fieldnames as the source, so:
¤ OleDbConnection conSrc =
¤ new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;"+
¤ "data source=" + @"c:\source.mdb" );
¤ conSrc.Open();
¤ string insertstring = @"INSERT INTO tablename IN "c:\destination.mdb"
¤ SELECT * FROM tablename";
¤ OleDbCommand cmd = new OleDbCommand(insertString, conSrc);
¤ cmd.ExecuteNonQuery();

The following SQL string works for me (connect to the Access database not Oracle):

INSERT INTO [AccessTable] SELECT * FROM [OracleTable] IN '' [ODBC;Driver={Microsoft ODBC For
Oracle};Server=OracleServer;Uid=userid;Pwd=password;]


Paul
~~~~
Microsoft MVP (Visual Basic)
 
Reply With Quote
 
Troy McLure
Guest
Posts: n/a
 
      2nd Nov 2005
I'll try that. Thanks!

Paul Clement wrote:
> On Sat, 29 Oct 2005 01:39:42 +0200, Troy McLure <(E-Mail Removed)> wrote:
>
> ¤ I have used the code below to copy data from one Access file to another
> ¤ Access file, and it's seems to be pretty fast. When the source tables
> ¤ are in Oracle and using an OracleConnection as source, my insertstring
> ¤ won't work anymore. Will I have to start filling datasets, traverse the
> ¤ rows and copy each field in for-loops? Won't that be terribly slow? Is
> ¤ there a faster way?
> ¤
> ¤ //Destination Access file exists and has the same tablenames and
> ¤ fieldnames as the source, so:
> ¤ OleDbConnection conSrc =
> ¤ new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;"+
> ¤ "data source=" + @"c:\source.mdb" );
> ¤ conSrc.Open();
> ¤ string insertstring = @"INSERT INTO tablename IN "c:\destination.mdb"
> ¤ SELECT * FROM tablename";
> ¤ OleDbCommand cmd = new OleDbCommand(insertString, conSrc);
> ¤ cmd.ExecuteNonQuery();
>
> The following SQL string works for me (connect to the Access database not Oracle):
>
> INSERT INTO [AccessTable] SELECT * FROM [OracleTable] IN '' [ODBC;Driver={Microsoft ODBC For
> Oracle};Server=OracleServer;Uid=userid;Pwd=password;]
>
>
> Paul
> ~~~~
> Microsoft MVP (Visual Basic)

 
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
Access Relationships (Oracle Tables) meyerryang Microsoft Access 1 23rd Jan 2008 04:02 AM
Access linked tables to Oracle =?Utf-8?B?WC4gWmhhbmc=?= Microsoft Access External Data 0 17th Feb 2006 03:21 PM
How to Link tables from an Oracle db to my Access db =?Utf-8?B?ZmxvZ3l1?= Microsoft Access VBA Modules 0 11th Jan 2005 06:13 PM
Convert Tables - Access to Oracle Jason Gyetko Microsoft Access 2 4th Dec 2004 01:07 AM
Some Tables from Access to Oracle Juan Enrique Bellon Microsoft Access External Data 1 13th Nov 2003 08:02 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:56 PM.