搜尋資料條目

In forms or database tables, you can search through data fields, list boxes, and check boxes for specific values.

若要使用此指令...

Find Record icon on the Table Data bar and Form Design bar.

Find Record Icon

搜尋資料項目...


在表格中搜尋時,搜尋範圍為目前表格的資料欄位。在表單中搜尋時,搜尋範圍為與表單連結的表格之資料欄位。

tip

The search described here is carried out by LibreOffice. If you want to use the SQL server to search in a database, then you should use the Form-based Filters icon on the Form bar.


此搜尋功能也適用於表格控制項。呼叫表格控制項的搜尋功能時,可以對表格控制項中與所連結的資料庫表格之資料庫欄相對應的每一欄進行搜尋。

搜尋內容

指定搜尋類型。

文字:

在方塊中輸入搜尋術語,或者從清單中選取搜尋術語。游標下的文字已複製到 [文字] 組合方塊中。請注意,在表單中執行搜尋時,無法處理定位鍵和斷行。

Your search terms will be saved as long as the table or the form document is open. If you are running more than one search and you would like to repeat the search term, you can select a previously used search term from the combo box.

欄位內容是 NULL

指定搜尋不含資料的欄位。

欄位內容不等於 NULL

指定搜尋包含資料的欄位。

區塊

指定要搜尋的欄位。

格式

指定要在其中進行搜尋的邏輯表單。

note

只有在目前表單文件包含多個邏輯表單時,[表單]組合方塊才會顯示。在表格或查詢中搜尋時,該組合方塊不會顯示。


表單文件中可以包含多個邏輯表單。每個邏輯表單都是單獨的表單部份,並各自連結一個表格。

[表單]組合方塊包含所有含有控制項的邏輯表單之名稱。

全部的欄位

在所有欄位中搜尋。如果在表格中執行搜尋,搜尋範圍為表格中的所有欄位。如果在表單中執行搜尋,搜尋範圍為邏輯表單 (在 [表單] 下輸入的表單) 的所有欄位。如果在表格控制項欄位中執行搜尋,則搜尋範圍為連結至有效資料庫表格欄位的所有欄。

請注意,目前邏輯表單的欄位無需與表單文件的欄位相同。如果表單文件包含指向多個資料源 (即多個邏輯表單) 的欄位,則使用[所有的欄位]選項後,只會搜尋表單文件中連結至資料源的欄位。

個別的欄位

在指定的資料欄位中搜尋。

設定

定義控制搜尋的設定。

位置

指定搜尋術語和欄位內容之間的關係。下列選項可用:

Position

Description

任意在欄位中

會搜尋所有於位於欄位開頭、結尾或置中任意位置上,包含搜尋項目的欄位。

在欄位開頭

會搜尋所有在欄位開頭包含搜尋項目的欄位。

在欄位結尾

會搜尋所有在欄位結尾包含搜尋項目的欄位。

整個欄位

會搜尋包含與欄位內容完全吻合的搜尋項目的全部欄位。


note

如果選取欄位 [萬用字元表示式],就不能使用這個功能。


使用欄位格式

指定在目前文件中搜尋時考量所有的欄位格式。欄位格式是指所有可見的格式,可以透過以下方法建立:

  1. 在欄位屬性的表格設計中,

  2. 在關於欄格式的資料檢視中,

  3. 在關於控制項-屬性的表單中。

當您想在工作表的資料檢視或在表單中搜尋資料時,您可選擇要在搜尋時考慮目前顯示的格式,或資料庫的標準格式。如果選取「使用欄位格式」欄位,則會使用工作表的資料檢視中或表單中設定的格式進行搜尋;如果沒有選取此欄位,則會在資料庫中利用所儲存的格式進行搜尋。

示例:

You have a date field, which is saved in "DD.MM.YY" format in the database (for example, 17.02.65). The format of the entry is changed in the data source view to "DD MMM YYYY" (17 Feb 1965). Following this example, a record containing February 17 is only found when the Apply field format option is on:

使用欄位格式

搜尋樣式

開啟

會找到「Feb」,但不會找到「2」。

關閉

會找到「2」,但不會找到「Feb」。


一般建議利用欄位格式進行搜尋,因為一旦接受 (內部的) 標準格式,可能會出現不想要的搜尋結果。

下列示例說明,不含欄位格式的搜尋可能出現的問題。這些情形端視使用的資料庫而定,且只會在特定的內部標準格式中出現:

搜尋結果

「原因」

"5" returns "14:00:00" as a time.

Time fields are not defined for dBASE databases and must be simulated. To internally display the time "14:00:00", a "5" is necessary.

"00:00:00" returns all records of a standard date field.

資料庫內部會以組合的日期/時間欄位儲存日期數值。

即使在「位置」下選取了「整個欄位」選項,「45.79」仍不會找到「45.79」。

The view shown does not match what is stored internally. For example, if value "45.789" is stored in the database as a field of type "Number/Double" and the shown formatting is set to display only two decimals, "45.79" is only returned in searches with field formatting.


在此情況下,標準格式是指內部儲存的資料所採用的格式。使用者不一定可以看到此格式,尤其是將其用於模擬資料類型時 (例如,dBASE 資料庫中的時間欄位)。這取決於使用的資料庫和個別資料類型。如果只希望搜尋實際顯示的內容,則可透過欄位格式進行搜尋。這包含日期、時間、日期/時間和數字/雙精度等類型的欄位。

However, searching without Apply field format is appropriate for larger databases with no formatting issues, because it is faster.

若正在搜尋核取方塊的值,且啟動了 [採用欄位格式],則已標記的核取方塊會顯示為「1」,未標記的核取方塊會顯示為「0」,而未定義的 (三重狀態) 核取方塊則顯示為空字串。若執行搜尋時,[採用欄位格式] 設定為關閉,則會顯示預設值「TRUE」或「FALSE」(取決於所用的語言)。

如果在清單方塊中搜尋時使用[採用欄位格式]選項,則搜尋結果為清單方塊中顯示的文字。但如果不使用[採用欄位格式],搜尋結果將為採用標準欄位格式的內容。

精確搜尋

指定搜尋時要區分大小寫。

向後搜尋

指定以相反方向搜尋,即從最後一個資料條目到第一個資料條目。

從開始/結束

重新開始搜尋。向前搜尋是從第一條記錄開始重新搜尋。向後搜尋則是從最後一條記錄開始重新搜尋。

萬用字元表示式

You can use the following wildcards:

萬用字元

涵義

示例

?

用於剛好一個任意字元

「?loppy」會找到「Floppy」

「M?ller」會找到如 Mler 和 M闤ler

*

用於 0 或更多任意字元

「*-*」會找到「ZIP-Drive」和「CD-ROM」

「M*er」會找到所有以「M」開頭,且「er」結尾的項目 (例如,Mler、M闤ler、Meier)


If you want to search for the actual characters ? or *, precede them with a backslash: "\?" or "\*". However, this is only necessary when Wildcard expression is enabled. When the option is not enabled, the wildcard characters are processed like normal characters.

常規表述式

Searches with regular expressions. The same regular expressions that are supported here are also supported in the LibreOffice Find & Replace dialog.

根據常規表述式的搜尋可提供更多項目作為萬用字元搜尋,但已對於一般使用已足夠,且能輕易擁有。當您根據常規表述式進行搜尋時,下列字元即符合萬用字元搜尋:

萬用字元搜尋

根據常規表述式進行搜尋

?

.

*

.*


相似字搜尋

Find terms that are similar to the Find text. Select this checkbox, and then click the Similarities button to define the similarity options.

符合字元寬度 (僅在啟用亞洲語言時有效)

Distinguishes between half-width and full-width character forms.

拼音類似 (日文) (僅在啟用亞洲語言時有效)

Lets you specify the search options for similar notation used in Japanese text. Select this checkbox, and then click the Sounds button to specify the search options.

Sets the search options for similar notation used in Japanese text.

當作相等處理

Specifies the options to be treated as equal in a search.

忽略

Specifies the characters to be ignored.

狀態

[狀態]行顯示此搜尋所返回的資料條目。如果搜尋到達表格的結尾處 (或起始處),該搜尋會自動從另一端繼續進行。

In very large databases, finding the record in reverse search order can take some time. In this case, the status bar informs you that the records are still being counted.

Search/Cancel

如果搜尋成功完成,則表格中相應的欄位會標明出來。再次按一下[搜尋]按鈕,可以繼續搜尋。按一下[取消]按鈕,可以取消搜尋程序。

關閉

關閉對話方塊。上一個搜尋的設定將會一直儲存,直到您退出 LibreOffice

如果開啟了多個表格或表單,您可以為每個文件設定不同的搜尋選項。當您關閉這些文件時,僅儲存最後所關閉文件的搜尋選項。

Please support us!