容易解决的
数据库表中的各字段对应着序号:
所以你只要知道你数据库的字段数就可以查询
以下是在应用程序中实现:
private sub query_db()
    set rs=db.execute(Table)
    i=0
    do while i<colum
        sql="select * from Table where rs(0) like '%"&key&"%'"
        set rs0=db.execute(sql)
    i=i+1
    loop
end sub 
'其中db为你所打开的记录源,
'table是你所要查询的表名,
'key是你要查的关键字.
'colum是table表的字段数

解决方案 »

  1.   

    IF EXISTS (SELECT name FROM sysobjects          WHERE name = 'searchname' AND type = 'P')   DROP PROCEDURE searchnameGocreate procedure searchname @sname varchar(20)Asbegincreate table #TableList(  資料表  char(200),  字段 char(200)) declare @table varchar(200)declare @col varchar(200) set nocount on /*不會顯示 (有關受影響的資料列數目) 訊息。*/declare curTab scroll cursor for select name from sysobjects where xtype='u'open curTabfetch next from curTab into @tablewhile @@FETCH_STATUS=0begin  declare curCol scroll cursor for select name from syscolumns 
    where (xtype=175 or xtype=167) and (id in (select id from sysobjects where name=@table))
    ----      char-->175,varchar-->167
      open curCol  fetch next from curCol into @col  while @@FETCH_STATUS=0  begin    execute('insert into #TableList select '''+@table+''','''+@col+''' from '+@table+' where '+@col+'='''+@sname+'''')  fetch next from curCol into @col  end  close curCol  deallocate curCol  fetch next from curTab into @tableendclose curTabdeallocate curTabset nocount offselect  distinct * from #TableListdrop table #tablelist  end
    --exec searchname '20020100002'
    --->(在當前數据庫中所有表中尋找特定信息)
    --參考一位前輩的貼子