如何檢查Access的表單裡是否有東西 |
答題得分者是:老大仔
|
egghead253
一般會員 發表:25 回覆:13 積分:7 註冊:2009-05-01 發送簡訊給我 |
|
老大仔
尊榮會員 發表:78 回覆:837 積分:1088 註冊:2006-07-06 發送簡訊給我 |
|
christie
資深會員 發表:30 回覆:299 積分:475 註冊:2005-03-25 發送簡訊給我 |
// Create a new project and
// add a TADOConnection (ADOConnection1), a TButton (Button1) // ConnectionString = 'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=XMain.mdb;Persist Security Info=False' unit RTV_TABu; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, DB, ADODB, StdCtrls; type TForm1 = class(TForm) ADOConnection1: TADOConnection; Button1: TButton; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject); var rs:TADODataSet; begin caption:=''; // Get the Database Schema Information (Tables / Views) // rs := TADODataSet.Create(Self); ADOConnection1.OpenSchema(siTables,EmptyParam,EmptyParam, rs); // // Field 0 contains the Database Name - ignore. // Field 1 contains the Schema No - ignore. // while not rs.Eof do begin //if Pos('SYSTEM', UpperCase(rs.Fields[3].Value)) = 0 then if rs.Fields[3].Value='TABLE' then caption:=caption rs.Fields[2].AsString ' / ';//ShowMessage(rs.Fields[2].AsString) rs.Next; end; rs.Close; rs.Free; end; end.
------
What do we live for if not to make life less difficult for each other? |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |