oracle-databaseadoconnection-stringsysdba

How can I connect to an Oracle database as SYS using an ADO connection string?


I am trying this:

Provider=MSDASQL.1;Persist Security Info=False;User ID=sys;Password=pwd;Initial Catalog=DATABASE;Data Source=OdbcDataSource;DBA Privilege=SYSDBA

But I get the error:

[Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed

I'm using Delphi, but answers in any language are welcome.

Clarification: I am able to connect as a normal user. I run into trouble when I try to connect AS SYSDBA.


Solution

  • You can't connect as SYSDBA using standard System.Data.OracleClient, as stated by this post : http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2245591&SiteID=1.

    You can do that using ODP .NET (Oracle Data Provider for .NET), or other third parties library. If you're planning to build serious Oracle Application on .NET, I suggest you at least look at ODP.NET