function DBOpenDataSet(AConn: TADOConnection; ADODataSet: TADODataSet;
sSql: string = ''): boolean;
begin
with ADODataSet do
begin
Connection := AConn;
Active := False;
ConnectionString := '';
LockType := ltBatchOptimistic;
if Trim(sSql) <> '' then
CommandText := sSql;
CommandType := cmdText;
Active := True; //在vista下运行到此句时,会卡个两三秒,在xp下则不会
end;
Result := True;
end;
sSql: string = ''): boolean;
begin
with ADODataSet do
begin
Connection := AConn;
Active := False;
ConnectionString := '';
LockType := ltBatchOptimistic;
if Trim(sSql) <> '' then
CommandText := sSql;
CommandType := cmdText;
Active := True; //在vista下运行到此句时,会卡个两三秒,在xp下则不会
end;
Result := True;
end;
你用什么开发的客户端 delphi2007+? 以前版本开发出来的东西多少和vista有些不兼容
启用方法:运行sql server configuration manager \ sql2005网络配置 \ 启用Tcp/IP