I would like to connect to an Oracle database.
Could anyone tell me how to configure my ODBC DNS
and what is the connection string?
Printable View
I would like to connect to an Oracle database.
Could anyone tell me how to configure my ODBC DNS
and what is the connection string?
You would be better off using ADO. You will also need the Oracle client installed on your macine and any other machine which will use your Application.
You will need to include the references to both ADO and Oracle. These are MS Data Environment, MS ActiveX Data Objects, MS Data Formatting Object Library and Oracle InProc Server x.x Type Library.
Thats about it! Hope that helps!Code:Dim cn As New ADODB.Connection, rs1 As New ADODB.Recordset
UserConnectionString = "Provider=MSDAORA.1;Password=" _
& myLoginUserPassword & ";User ID=" & myLoginUserName _
& ";Data Source=" & myDatabaseServer & ";Persist Security Info=True"
Set cn1 = New ADODB.Connection
cn1.Open UserConnectionString
Set rs1 = New ADODB.Recordset
rs1.CursorType = adOpenDynamic
rs1.LockType = adLockPessimistic
Thanks it helps a lot.
:), Tadej