當前位置:編程學習大全網 - 源碼下載 - 數據集源代碼分析

數據集源代碼分析

如果可能的話,可以從省到門牌號。這是壹個很簡單的問題。先在數據庫裏準備壹張表,包括省、市、縣(市)、區(鄉鎮)、村(居委會、街道辦)、組(胡同)、門牌號。

在界面上獲得六個combobox 1-6組件。

獲取另壹個ADODATEset組件並連接數據庫;

當界面顯示時,加載第壹個框並保存名稱。

程序TForm1。TabSheet2Show(發送方:to object);

定義變量

I,j:word;

開始

ADODATAset。關閉;

ADODATAset。CommandText:=“”;

Adodataset.commandtext: = '從xzqhb中選擇不同的省份';

ADODATAset。開放;

如果ADODATAset。RecordCount & gt那麽0

開始

combobox1。物品。清除;

對於i:=0到ADODATAset。記錄計數-1 do

開始

combobox 1 . items . add(ado dataset . field values['省']);

ADODATAset。接下來;

結束;

結束;

結束;

在combobox1的更新事件中,寫加載城市的代碼。

程序TForm1。ComboBox1Change(發件人:to object);

定義變量

I,j:word;

開始

開始

ADODATAset。關閉;

ADODATAset。CommandText:=“”;

ado dataset . commandtext:= ' Select Distinct from xzqhb where province = ' '+combobox 1 . text+' ' ' ';

ADODATAset。開放;

如果ADODATAset。RecordCount & gt那麽0

開始

combobox2。物品。清除;

對於i:=0到ADODATAset。記錄計數-1 do

開始

combobox 2 . items . add(ado dataset . field values[' city]);

ADODATAset。接下來;

結束;

結束;

結束;

在combobox2的更新事件中,寫入裝貨縣(市)的代碼。

程序TForm1。ComboBox2Change(發送方:to object);

定義變量

I,j:word;

開始

開始

ADODATAset。關閉;

ADODATAset。CommandText:=“”;

Adodataset.commandtext: = '從xzqhb中選擇不同的縣(市),其中Province = ' '+combobox 1 . text+' ',City = ' '+combobox 2 . text++ ' ' ' ';

ADODATAset。開放;

如果ADODATAset。RecordCount & gt那麽0

開始

combobox3。物品。清除;

對於i:=0到ADODATAset。記錄計數-1 do

開始

combobox 3 . items . add(ado dataset . field values[' county(city)']);

ADODATAset。接下來;

結束;

結束;

結束;

其他的框自己寫,註意SQL語句的變化,尤其是where子句。

  • 上一篇:龍南pc源代碼
  • 下一篇:如何查詢自己的星座盤,占星術系列——什麽是星盤
  • copyright 2024編程學習大全網