是这样的我在服务器上写:
procedure insertdata(const username,password:WideString);safecall;procedure TTextserver.insertdata(const username,password:WideString);safecall;
begin
with gy_table do
begin
close;
sql.Clear;
sql.add('insert into table1 (username,password) values('''+username+''','''+password+''' )');
ExecSQL;
end;
end;在客户端可以调用socketconnection.appserver.insertdata('''+username.text+''','''+password.text+''');可我写了一个
function Get_power(const username, password: WideString): WideString;safecall;
    
function TTextserver.Get_power(const username, password: WideString): WideString;safecall;
begin
with gy_table do
begin
close;
sql.clear;
sql.add('select * from table1 where username='''+username+''' and password='''+password+''' ');
if not eof then
result:=fieldbyname('power').asstring
else
result:='error';
end;
end;在客户端就是不让用这个方法,为什么呀?(我类别库用的不好)

解决方案 »

  1.   

    好像没 open 把
    function Get_power(const username, password: WideString): WideString;safecall;
        
    function TTextserver.Get_power(const username, password: WideString): WideString;safecall;
    begin
    with gy_table do
    begin
    close;
    sql.clear;
    sql.add('select * from table1 where username='''+username+''' and password='''+password+''' ');open  <----------- 加 1句if not eof then
    result:=fieldbyname('power').asstring
    else
    result:='error';
    end;
    end;
      

  2.   

    哦,加了也不行,主要是谁能教 我在类型库里如何建function,我建了无法调用