PDA

View Full Version : Importing Oracle tables to ms access



ramserp
11-15-2010, 07:21 AM
Hi All,

I need import some oracle tables( For eamplex 2 fields from table A and 3 fields from tableB to Ms-Access and load the data in ms-access table. I am not clear out to get data from oracle. Please kindly help me with the code to connect to oracle database.

Thanks & Regards
rams

orange
11-15-2010, 05:19 PM
Talk to your Oracle dba/administrator.
You'll need an account (username/password) on Oracle.
You'll likely need help setting up an ODBC connection as well.

ramserp
11-16-2010, 05:44 AM
Thank you Orange for your reply. How can we extract 2 columns from each of oracle tables.

Please provide me sample code.

Thanks & Regards
Ramesh

stanl
11-16-2010, 07:14 AM
How can we extract 2 columns from each of oracle tables.Please provide me sample code.

Thanks & Regards
Ramesh

Since this is an Access forum, I assume you have and are using Access. If you follow the advice previously given and have an Oracle ODBC driver installed and a user/password to connect to Oracle Tables.... then ...... the best way to get started is to Link the Oracle tables to an Access DB - at that point you can create queries just like with normal Access tables. If you then want to write code for these queries you can use the SQL view and an Oracle ADO ConnectionString. Just throwing out code may not be that helpful at this point, however


cConn = "Provider=OraOLEDB.Oracle.1;Password=hr;Persist Security Info=True;User ID=hr;Data Source=XE"
oConn = CreateObject("ADODB.Connection")
oConn.Open cConn
cSQL = "create table date_table (time_stamp_tz TIMESTAMP WITH TIME ZONE,time_stamp_ltz TIMESTAMP WITH LOCAL TIME ZONE)"
oConn.Execute cSQL


gives you a general idea..

.02 Stan