直接用ado连接的远程sql server 2K,就一个应用程序,在我的机器上很好(本机有delphi环境),但在别人的机器上没有delphi环境的就报连不上服务器,是不是程序编译时还需要加什么东西上去?

解决方案 »

  1.   

    你应该检查一下你程序中连接sql server 2K的方式,以及sql server 2K的安全认证管理方式。
      

  2.   

    你是以什么方式联接数据库的,如果是ODBC,应配置ODBC
      

  3.   

    哥们和我的问题一样等着达者解决吧
    http://expert.csdn.net/Expert/topic/2597/2597618.xml?temp=.1880304
      

  4.   

    如果是用odbc的方式来连接的,还要在客户端配置好odbc如果是用ole的方式连接的,应该没问题了但是要注意把相应的 bpl 以及dll文件copy到客户端才可以midas.dll  等等
      

  5.   

    动态创建ADO的连接,使用相对路径就可以了
    AdoConn.Connected:=false;
    spath:=ExtractFilePath(Application.ExeName)+'\data\mlcz.mdb';
    AdoConn.ConnectionString:='Provider=Microsoft.Jet.OLEDB.4.0;Data Source='+spath+';Persist Security Info=False';
    AdoConn.Connected:=true;
      

  6.   

    1:odbc的问题,如果你用odbc连接的话!!!2:如果没有以用odbc连接
    是安全认证的问题
    你看看sql server的认证方式是什么?
    问题就在那里
      

  7.   

    如果用ODBC的话不用DLL,不过看看你的连接方式对否,是不是动态连接!!!
      

  8.   

    去那台没delphi 的机器上,装 ADO 的控件(或BDE 驱动)吧!!!
      

  9.   

    uses inifiles;
    var inifile:tinifile;
        strconnection:string;//数据库连接字符串inifile:=tinifile.Create('c:\information.ini');//打开ini文件
    //读出ini文件的数据库配置信息
    strconnection:='Provider='+inifile.Readstring('数据库连接','Provider','')+';';
    strconnection:=strconnection+'Persist Security Info='+ inifile.Readstring('数据库连接','Persist Security Info','')+';';
    strconnection:=strconnection+ 'User ID='+inifile.Readstring('数据库连接','User ID','sa')+';';
    strconnection:=strconnection+ 'Initial Catalog='+ inifile.Readstring('数据库连接','Initial Catalog','')+';';
    if inifile.Readstring('数据库连接','Data Source','')<>'' then
      strconnection:=strconnection+ 'Data Source='+ inifile.Readstring('数据库连接','Data Source','')+';';
    strconnection:=strconnection+ 'Locale Identifier='+ inifile.Readstring('数据库连接','Locale Identifier','2052')+';';
    strconnection:=strconnection+ 'Connect Timeout='+ inifile.Readstring('数据库连接','Connect Timeout','15')+';';
    strconnection:=strconnection+ 'Use Procedure for Prepare='+ inifile.Readstring('数据库连接','Use Procedure for Prepare','1')+';';
    strconnection:=strconnection+ 'Auto Translate='+inifile.Readstring('数据库连接','Auto Translate','')+';';
    strconnection:=strconnection+ 'Packet Size='+inifile.Readstring('数据库连接','Packet Size','4096')+';';
    strconnection:=strconnection+ 'Workstation ID='+inifile.Readstring('数据库连接','Workstation ID','');
    //连接数据库
    with ADOConnection1 do
    begin
      Connected:=false;
      ConnectionString:=strconnection;
      try
        connected:=true;
       except
        application.MessageBox('数据库联接错误!请执行数据库联接程序。','物业管理',MB_ICONERROR+mb_ok);
        application.Terminate;//退出程序
      end; //end try
    end;//end with下面是ini文件结构
    [数据库连接]
    Provider=SQLOLEDB.1
    Persist Security Info=False
    User ID=sa
    Initial Catalog=此处填写需要连接的数据库的名字
    Data Source=此处填写数据库所在的机器名字
    Locale Identifier=2052
    Connect TimeOut=10
    Use Procedure for Prepare=1
    Auto Translate=True
    Packet Size=4096以后修改ini文件的内容就行啦,(修改机器名字),不需要修改程序,不需要设置odbc。
      

  10.   

    多谢各位!
    别人的机器是2K的机器,我用的是Ado方式,与ODBC无关吧?
    我在别人的机器上装了mdac2.8(微软主页上下的),就解决问题了。
    不过真的多谢各位了!