高手请加我qq:11676870
在线等!!!

解决方案 »

  1.   

    procedure TMainForm.SpeedButton7Click(Sender: TObject);var
    mj1 : integer;
    mj2 : integer;
    zj1 : integer;
    zj2 : integer;
    ssql: string;
    searchFeatures : Features;
    EsearchFeatures : Features;
    wid:string;beginmj1 := integer(txtmj1.Text);
    mj2 := integer(txtmj2.Text);
    zj1 := integer(txtzj1.Text);
    zj2 := integer(txtzj2.Text);
      if mj1 > mj2 then
      mj1 := integer(txtmj2.Text);
      mj2 := integer(txtmj1.Text);
      if zj1 > zj2 then
      zj1 := integer(txtzj2.Text);
      zj2 := integer(txtzj1.Text);g_Title := '查询结果:';Map1.Layers.ClearSelection;ssql := 'select 组名,户编号 from TENANCY where 1=1 ';if txtssqy.Text <> '' then
      ssql := ssql + ' and 所属区域 = ' + QuotedStr(txtssqy.Text);if txtlxr.Text <> '' then
      ssql := ssql + ' and 联系人 = ' + QuotedStr(txtlxr.Text);if txtlxfs.Text <> '' then
      ssql := ssql + ' and 联系方式 = ' + QuotedStr(txtlxfs.Text);if txtlxdz.Text <> '' then
      ssql := ssql + ' and 联系地址 = ' + QuotedStr(txtlxdz.Text);if txthx.Text <> '' then
      ssql := ssql + ' and 户型 = ' + QuotedStr(txthx.Text);if txtlc.Text <> '' then
      ssql := ssql + ' and 楼层 = ' + QuotedStr(txtlc.Text);if txtwz.Text <> '' then
      ssql := ssql + ' and 位置 = ' + QuotedStr(txtwz.Text);if (txtmj1.Text <> '') and (txtmj2.Text <> '') then
      ssql := ssql + ' and 面积 > ' + string(mj1) + ' and 面积 < ' + string(mj2) ;if (txtzj1.Text <> '') and (txtzj2.Text <> '') then
      ssql := ssql + ' and 租金 > ' + string(zj1) + ' and 租金 < ' +string(zj2);if txtfwss.Text <> '' then
      ssql := ssql + ' and 房屋设施 = ' + QuotedStr(txtfwss.Text);ShowMessage(ssql);
    adoSearch.Close;
    adoSearch.sql.Clear;
    adoSearch.sql.Add(ssql);
    adoSearch.Open;if not adoSearch.Eof then
    begin
      adoSearch.First;
      searchFeatures := searchLayer.NoFeatures;
      EsearchFeatures := searchLayer.AllFeatures;  while not adoSearch.Eof do
      begin
        wid:=adoSearch.fieldbyname('组名').asstring + adoSearch.fieldbyname('户编号').AsString;    try
          searchFeatures.Add(VsearchLayer.Search('GID="' + wid + '"'));
        except
        on Exception do
        end;    adoSearch.Next;
      end;  if searchFeatures.Count <> 0 then
      begin
        VsearchLayer.selection.add(searchFeatures);
        g_ftrs := searchFeatures;
        Self.dxDockSiteMain.ShowingControl := nil;
        startTime := Now;
        FlashTimer.Interval := myinifile.ReadInteger('FLASH', 'TimerInterval', 200);
        flashTimer.Enabled := true;
      end
      else
        Application.MessageBox('地图上没有相关的户信息.','搜索结果提示',0);
    end
    else
      showmessage('没有相关的户信息');
      exit;end;
    问题基本解决,已经实现了地图定位以及结果闪烁,但在查询面积和租金的地方还有点错误
    由于对delphi不熟,请各位delphi高手指正!
      

  2.   

    在查询面积和租金的时候报错,对delphi的语法不太熟悉,请大伙指正!
      

  3.   

    警告楼主不要倒分
    http://community.csdn.net/Expert/topic/3322/3322493.xml?temp=.2152674
    http://community.csdn.net/Expert/topic/3308/3308296.xml?temp=.6293451