我用了以下这段代码procedure TForm1.Button1Click(Sender: TObject);
var
i:Integer;
j,oNames,oSQLApp:OleVariant;
begin
oSQLApp:=CreateOleObject('SQLDMO.Application');
oNames:=oSQLApp.ListAvailableSQLServers;
ComBoBox1.Items.Clear;
for i := 1 to oNames.Count do
begin
j:=i;
ComBoBox1.Items.Add (oNames.Item(i));
end;
end;出现如下错误:[Error] Reduce_Log.pas(271): Undeclared identifier: 'CreateOleObject'
[Error] Reduce_Log.pas(271): Undeclared identifier: 'SQLDMO'
[Error] Reduce_Log.pas(271): Statement expected, but expression of type 'TApplication' found怎么解决呢?
var
i:Integer;
j,oNames,oSQLApp:OleVariant;
begin
oSQLApp:=CreateOleObject('SQLDMO.Application');
oNames:=oSQLApp.ListAvailableSQLServers;
ComBoBox1.Items.Clear;
for i := 1 to oNames.Count do
begin
j:=i;
ComBoBox1.Items.Add (oNames.Item(i));
end;
end;出现如下错误:[Error] Reduce_Log.pas(271): Undeclared identifier: 'CreateOleObject'
[Error] Reduce_Log.pas(271): Undeclared identifier: 'SQLDMO'
[Error] Reduce_Log.pas(271): Statement expected, but expression of type 'TApplication' found怎么解决呢?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货