小问题:
   ADOQUERY通过SQL语句查询,我希望在DbGrid中显示查询出的数据,不知道是否DbGrid。属性=ADOQUERY.ExecSQL.有关联才可以,还有我就是不知道DbGrid后跟什么属性,谢谢!

解决方案 »

  1.   

    看下我这个的设置
    object Form1: TForm1
      Left = 192
      Top = 110
      Width = 696
      Height = 480
      Caption = 'Form1'
      Color = clBtnFace
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -11
      Font.Name = 'MS Sans Serif'
      Font.Style = []
      OldCreateOrder = False
      OnCreate = FormCreate
      PixelsPerInch = 96
      TextHeight = 13
      object Button1: TButton
        Left = 576
        Top = 32
        Width = 75
        Height = 25
        Caption = 'Button1'
        TabOrder = 0
      end
      object DBGrid1: TDBGrid
        Left = 136
        Top = 208
        Width = 320
        Height = 120
        DataSource = DataSource1
        TabOrder = 1
        TitleFont.Charset = DEFAULT_CHARSET
        TitleFont.Color = clWindowText
        TitleFont.Height = -11
        TitleFont.Name = 'MS Sans Serif'
        TitleFont.Style = []
      end
      object DataSource1: TDataSource
        DataSet = ADOQuery1
        Left = 144
        Top = 56
      end
      object ADOQuery1: TADOQuery
        Active = True
        ConnectionString = 
          'Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security In' +
          'fo=False;Initial Catalog=bnbridgeinfo;Data Source=.'
        CursorType = ctStatic
        Parameters = <>
        SQL.Strings = (
          'select * from baseinfo')
        Left = 312
        Top = 64
      end
    end
      

  2.   

    ADOQUERY.ExecSQL是没返回值的,
    用ADOQUERY.Open
      

  3.   

    我也遇到过这个问题,connectionstring中没有选择4.0 OLE,而是选择的ODBC结果可以了
      

  4.   

    没有设置DBGRID的datasource属性吧