function  Tdm1.LoginToDb(user,pass,servername:string):boolean;
var
    rtn:boolean;
    conn:string;
begin
    with dm1.ADOConnection1 do
    begin
        if connected then close;
        conn:='Provider=Sybase.Oracle8ADOProvider.2;Password='+pass+';User ID='+user+';Data Source="";Persist Security Info=True;ServerName='+servername;
        adoconnection1.ConnectionString:= conn;
        try
            Open;
            rtn:= true;
        except
            rtn:= false;
        end;
    end;
    result:= rtn;
end;
我用上面这个函数可以联接远程oracle;
但是我的adoquery控件不能查询oracle数据库表:
    with dm1.event do
    begin
        if active then dm1.event.close;
        strsql:='select Count(table_name) count from user_tables where table_name='+''''+'TBL_STDBGL'+'''';
        sql.Text:=strsql;
        open;
这样就出错!!
但是同样这段代码联接本地oracle(本机的)就不会出问题!!!!
出错提示为:
Project dbtools.exe raised exception class EOleException with
message 'This provider is for user only with OEM applications. Please
contact MERANT to obtain a licensed version.
USA and Canada:   800-876-3101
....
....
我的ado是打过补丁的!win2000+d5的环境!救命呀大侠们

解决方案 »

  1.   

    怎么回事只出现二行?补上!
    function  Tdm1.LoginToDb(user,pass,servername:string):boolean;
    var
        rtn:boolean;
        conn:string;
    begin
        with dm1.ADOConnection1 do
        begin
            if connected then close;
            conn:='Provider=Sybase.Oracle8ADOProvider.2;Password='+pass+';User ID='+user+';Data Source="";Persist Security Info=True;ServerName='+servername;
            adoconnection1.ConnectionString:= conn;
            try
                Open;
                rtn:= true;
            except
                rtn:= false;
            end;
        end;
        result:= rtn;
    end;我这个函数能够联接oracle远程服务器。但是我的adoquery却不能取出表中的数据,adotable 也不能。如下:
        with dm1.event do
        begin
            if active then dm1.event.close;
            strsql:='select Count(table_name) count from user_tables where table_name='+''''+'TBL_STDBGL'+'''';
            sql.Text:=strsql;
            open;
        end;出错提示:This provider is for use only with OEM applications.Please contact MERANT to obtain a licensed version.
    USA and Canada: 800-876-3101
    ....
    ...
    我的ado是打过补丁的。win2000+d5的环境!
      

  2.   

    可能是你的联接字符串不对,不能用Sybase.Oracle8ADOProvider.2
    而且不要用ServerName,应该用data source.