Solved

insert from msaccess table into unlinked oracle table

Posted on 2014-02-24
2
304 Views
Last Modified: 2014-02-28
In msaccess I have to insert into an unlinked Oracle table. something like this:

insert into  [ODBC;UID=TOM;PWD=TOM_PWD;DSN=ORCLD;].T1 select [Field1] from [Table1];

where T1 is an Oracle table in TOM/TOM_PWD@ORCLD.
Table1 is an msaccess table.
note T1 must not be a linked table

Thanks
0
Comment
Question by:graham-n
  • 2
2 Comments
 
LVL 22

Expert Comment

by:Kelvin Sparks
ID: 39884812
You'll need to use ADODB for this, create a connection, write the insert string and execute it.

Kelvin
0
 
LVL 22

Accepted Solution

by:
Kelvin Sparks earned 210 total points
ID: 39884824
It would be along the lines of

Dim cnn As ADODB.Connection
Dim cmd As New ADODB.Command


Set cnn = New ADODB.Connection
cnn.ConnectionString = sConnect
cnn.Open

Set cmd = New ADODB.Command

    With cmd
        .ActiveConnection = cnn
        .CommandText = strSP
        .CommandType = adCmdText
        .CommandTimeout = 0
        .Execute
    End With
Set cmd = Nothing
Set cnn = Nothing

Where sCoonect is your connections string and strSP is the actual INSERT INTO table..... statement you want executed (in Oracle syntax)

Kelvin
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

With the internet and the ease of information transference, many professional jobs can be done anywhere today.  Why should it make a difference whether an x-ray is read in India or the United States as long as the radiologist is qualified?   Outso…
Microsoft Office Picture Manager was included in Office 2003, 2007, and 2010, but not in Office 2013. Users had hopes that it would be in Office 2016/Office 365, but it is not. Fortunately, the same zero-cost technique that works to install it with …
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now