谢谢各位,请高手指教!

解决方案 »

  1.   

    var TableList:TStrings;
        ADoConnection:TADoConnection;
    begin
        ADoConnection:=TADoConnection.Create(nil);
        TableList:=TStringlist.Create;
        adoConnection.GetTableNames(TableList,true)
        if  Tablelist.IndexOf(TableName)=-1 then
           表不存在
      

  2.   

    怎么不行呀?请问TStrings的控件在哪呀?
      

  3.   

    var 
      tbnames:tstringlist;
      ADoConnection1:TADoConnection;
    begin
      ADoConnection1:=TADoConnection.Create(nil);
      tbnames:=tstringlist.Create ;
      ADOConnection1.GetTableNames(tbnames,false);
      ListBox1.Items:=tbnames;
      adoConnection.GetTableNames(TableList,true)
        if  Tablelist.IndexOf(TableName)=-1 then
           表不存在
    end.
      

  4.   

    tstringlist 在哪个控件组里呀???
      

  5.   

    可以用这个试试
    try
      //ado.open
    except
      如果出错,可能是数据库里面没表了!!
    end;
      

  6.   

    前两个高手提到的 TStrings和tstringlist是哪个控件组里的呀???
      

  7.   

    tstringlist只是 类 。按楼上说的去试。你只要在form中添加:ListBox1即可
      

  8.   

    “Project Booke.exe raised exception class EOleException with message '[Microsoft][ODBC驱动程序管理器]未发现数据源名称并且未指定默认驱动程序'.Process stopped.use step or run to continue”使用了“ dickeybird888(于伟刚) ”大侠给的提示出现了上面的错误,请问是什么原因呀?还有var里的变量加在哪呀?
      

  9.   

    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, DB, ADODB, ExtCtrls, StdCtrls;type
      TForm1 = class(TForm)
        ComboBox1: TComboBox;
        Image1: TImage;
        ADOConnection1: TADOConnection;
        procedure FormShow(Sender: TObject);
        procedure Image1Click(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;var
      Form1: TForm1;implementation{$R *.dfm}procedure TForm1.FormShow(Sender: TObject);
    begin
      adoconnection1.GetTableNames(combobox1.Items,true);
    end;procedure TForm1.Image1Click(Sender: TObject);
    begin
    if combobox1.Items.IndexOf(combobox1.Text)=-1 then
    combobox1.Text:='所查的表不存在!';
    end;end.
      

  10.   

    TStrings 在 Classes 单元中.
      

  11.   

    dickeybird888(于伟刚) 的代码没有设ADoConnection1.connectstring 当然出错了,小鱼儿糊涂了??嗬嗬