procedure TFrm_DBBackupMain.SQLServerinitialization(
  SQLServerName: TComboBox);
var
  SQLServer: Variant;
  ServerList: Variant;
  i: integer;
begin
  // 初始化SQLServer 名称
  SQLServer := CreateOleObject('SQLDMO.Application');
  ServerList:= SQLServer.ListAvailableSQLServers;
  SQLServerName.Items.Clear ;
  for i := 1 to Serverlist.Count do
    SQLServerName.Items.Add(Serverlist.Item(i));
end;为什么我编一个EXE文件,在打开时执行这个过程会出错,提示[无效的字符串类别]我打包装在一个没有安装Delphi的电脑上,怎么会出现错误,在有Delphi的电脑上又没事!是不是需要什么东西支持??  是不是需要 MDAC 2.7 之类的

解决方案 »

  1.   

    sqldmo.dll 缺少了;注意这个是个com 对象,到对方机器上regsvr32 一下;
    这里是ms提供的发布信息,所需要的文件列表
    Installing SQL-DMO
    All required SQL-DMO components are installed as part of an instance of Microsoft® SQL Server™ server or client. SQL-DMO is implemented in a single dynamic-link library (DLL). You may develop SQL-DMO applications on either a client or a server. When using an OLE Automation controller as a development platform, such as Microsoft Visual Basic®, no additional files are required. Application development using C or C++ requires the SQL-DMO header files.SQL-DMO sample applications, providing additional reference material for SQL-DMO application development, are included with SQL Server.Directory File Description 
    C:\Program Files\Microsoft SQL Server\80\Tools\Binn Sqldmo.dll DLL implementing SQL-DMO objects. 
    C:\Program Files\Microsoft SQL Server\80\Tools\Binn Sqldmo80.hlp SQL-DMO help file used within the development environment to provide context sensitive help about SQL-DMO objects, properties and methods. 
    C:\Program Files\Microsoft SQL Server\80\Tools\Binn\
    Resources\xxxx Sqldmo.rll Localized resource file. The resource directory varies based on the national language of the instance of SQL Server client or server. For example, the directory 1033 is a decimal representation of the language identifier 0X0409, indicating English, U.S. 
    C:\Program Files\Microsoft SQL Server\80\Tools\
    Devtools\Include Sqldmo.h C/C++ header file containing SQL-DMO member function prototypes, enumerated data types, and macros. 
    C:\Program Files\Microsoft SQL Server\80\Tools\
    Devtools\Include Sqldmoid.h C/C++ header file containing SQL-DMO interface and class identifiers. 
    \Program Files\Microsoft SQL Server\MSSQL\Install Sqldmo.sql Transact-SQL script implementing stored procedures that support SQL-DMO. Available on SQL Server server-instance only. 
    C:\Program Files\Microsoft SQL Server\80\Tools\
    Devtools\Samples\Sqldmo ALL Sample applications illustrating SQL-DMO use. 
    To register the SQL-DMO components on a client computer From C:\Program Files\Microsoft SQL Server \80\Tools\Binn\Resources\<language> directory, execute: 
    \Program Files\Microsoft SQL Server \80\Tools\Binn\REGSVR32 SQLDMO.DLLFrom any directory, execute: 
    C:\Program Files\Microsoft SQL Server \80\Tools\Binn\REGSVR32.EXE C:\Program Files\Microsoft SQL Server \80\Tools\Binn\resources\1033\SQLDMO.RLL
      

  2.   

    楼上的意思,不太明白!
    能不能给个解决方法,是不是一定要装SQL
      

  3.   

    Delphi7+SQL 2000+Ado,打包时需要把什么东西打进去
      

  4.   

    在创建窗体前在DPR文件里注册sqldmo.dll
     用shellexecute 注册:regsvr32 sqldmo.dll