请问大家如何用delphi连接上远程计算机上的sql server服务器
解决方案 »
- 兄弟们有问题了,关于函数访问的问题???????????????????????????????????????????????????????????????
- 英雄!关于cxgrid获得鼠标焦点信息的问题!!!
- 有哪位知道学习做Delphi游戏方面入门的书?
- 怎样用Delphi调整屏幕的象素?急
- SpinEdit是什么?
- 用CTRL+空格时,出现错误提示“Unable to invoke code coplotion due to errors in source code”
- 多窗体程序,创建主窗体后,希望自动打开一个子窗体。发生错误。WHY
- 动态创建控件中的事件的问题?
- 高分征求2002年开发总结
- delphi中存储过程问题。
- 听说过很多‘BOM’,‘MRP计算’
- float类型数据四舍五入的函数?
SQLServer:Variant;
ServerList:Variant;
// i,nServers:integer;
// sRetValue:String;
begin
SQLServer := CreateOleObject('SQLDMO.Application');
ServerList:= SQLServer.ListAvailableSQLServers;
// nServers:=ServerList.Count;
if serverlist.count<1 then
begin //如果服务器不存在,则退出系统
showmessage('服务器不存在,请检测服务器是否已经开机或者服务是否打开了');
application.Terminate;
end
else
begin
showmessage(serverlist.item(1)+'服务器已经打开,可以正常使用本系统');
adoconnection1.ConnectionString:='Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=图书馆;Data Source='+ServerList.Item(1);
end;
// n12.Enabled:=false;
{
for i := 1 to nservers do
ListBox1.Items.Add(ServerList.Item(i)); }
SQLServer:=NULL;
serverList:=NULL;
end;
=========================
欢迎使用 论坛助手 For CSDN