OleDB Conn. String to Oracle

Results 1 to 3 of 3

Thread: OleDB Conn. String to Oracle

  1. #1
    keith5000 Guest

    Default OleDB Conn. String to Oracle

    I&#039;m having problems creating the correct connection string for my OleDbConnection object to connect to an Oracle database. Which parameters are required (Provider, Database, etc.)?<BR><BR>With old-school ADO I was connecting with only DSN, UID, and PWD. How is this rewritten in OleDb?<BR><BR><BR>Keith<BR>

  2. #2
    RobT Guest

    Default RE: OleDB Conn. String to Oracle


  3. #3
    keith5000 Guest

    Default got it -- Example Inside...

    I figured it out and it wasn&#039;t easy, so I thought I&#039;d share it:<BR><BR>you need these parameters in the connection string:<BR>* Provider ("Provider=MSDAORA" always for Oracle)<BR>* Data Source (not the ODBC data source but the TNS name!)<BR>* User ID<BR>* Password<BR><BR>ex:<BR>dim DBConn_Obj as new OleDbConnection ("Provider=MSDAORA; Data Source=ProductionDB; User ID=Joe; Password=oi;")<BR><BR><BR>and make sure you import the OleDb namespace at the top of the script (not the SqlClient namespace):<BR><BR>&#060;%@ import namespace="System.Data" %&#062;<BR>&#060;%@ import namespace="System.Data.OleDb" %&#062;<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts