procedure TForm1.FormCreate(Sender: TObject);
begin
  pass:='abs';
  user:='sys';
  servername:='absdate';
  mycon:='Provider=MSDAORA.1;Password= '+pass+ ';User ID= '+user+ ';Persist Security Info=True; '+ 'Data Source= '+servername;
  con1.ConnectionString:=mycon;
  con1.Open;
end;如上代码 连接oracle数据库 run后出现
---------------------------
Debugger Exception Notification
---------------------------
Project Project1.exe raised exception class EOleException with message 'ORA-28009: connection to sys should be as sysdba or sysoper'. Process stopped. Use Step or Run to continue.
---------------------------
OK   Help
---------------------------如何处理?谢谢赐教...

解决方案 »

  1.   

    procedure TForm1.FormCreate(Sender: TObject);
    begin
      pass:='abs';
      user:='sys';
      servername:='absdate';
      mycon:='Provider=MSDAORA.1;Password= '+pass+ ';User ID= '+user+ ';Persist Security Info=True; '+ 'Data Source= '+servername;
      con1.ConnectionString:=mycon;
      con1.Connected:=true;
    end;
      

  2.   

    sys需要以dba身份登录,sys as sysdba正确的方法是你以system用户登录,建立自己的用户,然后以这个用户登录进行操作,找本oracle基础的书看看,里面的三个用户sys/system/internal都是干嘛的,别乱用
      

  3.   


    那delphi应该咋写代码??查查
      

  4.   

    换个账户,要么用system账户登录