求教

解决方案 »

  1.   

    Database属性里输入数据库路径加上数据库文件名即可,同时需要Query和DataSource
      

  2.   

    用法和ADO一样的吧
      

  3.   

    我做了层简单封装,跟ado差不多,如下:type
      TSMDBParam=record
        dbType  : TDbType;
        server  : string;
        account : string;
        password: string;
        dbName  : string;
        port    : integer;
      end;
    function TSMUniDriver.Conntect(): boolean;
    begin
      Disconnect();
      case FDBParam.dbType of
        dtMySQL : FConnection.ProviderName := 'MySQL';
        dtMSSQL : FConnection.ProviderName := 'SQL Server';
        dtSqlite: FConnection.ProviderName := 'SQLite';
      end;
      FConnection.SpecificOptions.Values['UseUnicode'] := 'true';
      FConnection.SpecificOptions.Values['Direct']     := 'false';
      FConnection.Username := FDBParam.account;
      FConnection.Password := FDBParam.password;
      FConnection.Database := FDBParam.dbName;
      FConnection.Server   := FDBParam.server;
      FConnection.Port     := FDBParam.port;
      try
        FConnection.Connect;
        result := FConnection.Connected;
      except
        result := false;
      end;
    end;