if SQLConnection1.Connected=true then
SQLConnection1.Connected:=false;
SQLConnection1.Params.Clear;
SQLConnection1.Params.Values['user_name']:='sa';
SQLConnection1.Params.values['password']:='';
SQLConnection1.Params.Values['LibraryName']:='dbexpmss.dll';
SQLConnection1.Params.values['VendorLib']:='oledb';
sqlConnection1.Params.Values['GetDriverFunc']:='getSQLDriverMSSQL';
SQLConnection1.Params.Values['database']:='master';
SQLConnection1.Connected:=true;
showmessage('连接成功');
以上在WINXP SP2 + D7 + ADO2.8环境下测试成功,本机已经装过了SQL2000,所以不知道在没安装SQL2000的机器上是什么结果。由于是用DBEXPRESS是OLEDB方式连接SQL SERVER,所以应该保证该机器安装了MDAC2.6(ADO)以上,如果缺少文件的话,把那几个DLL文件打包到程序所在目录,Midas.dll、DBEXPMSS.DLL