PDA

Click to See Complete Forum and Search --> : Connecting to oracle????


Skeen
Aug 22nd, 2000, 08:54 AM
Aye Up Everybody,

I've written a small application to transfer data from .txt file on a server into an axcess database, all was good and well, But now I need to use the same prgram to connect to an oracle database and I just can't get it to work.
I'm using the following line of code ( The oracle database also has a username and password which will need to be incorporated aswell???)

Set DBconnect = Workspaces(0).OpenDatabase("D:\Oracle\Ora81\BIN\SQLPLUSW.EXE ")

The error message saise "unreccognisable database format"
Whatever the hell that means

Cheers 'n' beers ( and a big shout out to the manchester massif in de area - SKEEN

Mongo
Aug 22nd, 2000, 10:13 PM
Assuming you have Oracle drivers installed (if not, see MSDN Q140255), here's an ADO snippet to open your connection:

'Replace <User ID>, <Password>, <Server> with appropriate parameters.
Dim Conn As String
Dim Cn As ADODB.Connection
Conn = "UID=*****;PWD=*****;driver={Microsoft ODBC for Oracle};SERVER=dseOracle;"
Set Cn = New ADODB.Connection
With Cn
.ConnectionString = Conn
.CursorLocation = adUseClient
.Open
End With

A different tact that will save you time, should your Oracle table have less than 500K rows, would be to setup a DSN on your local machine and then link the Oracle table(s) within your existing Access db; then use your current code, as is.

Hope this helps ;)

Skeen
Aug 23rd, 2000, 06:15 AM
Certinly did!
Cheers