線上訂房服務-台灣趴趴狗聯合訂房中心
發文 回覆 瀏覽次數:854
推到 Plurk!
推到 Facebook!

尋找的問題

尚未結案
leon1019
一般會員


發表:16
回覆:3
積分:3
註冊:2005-02-12

發送簡訊給我
#1 引用回覆 回覆 發表時間:2005-03-06 23:52:49 IP:218.175.xxx.xxx 未訂閱
hi~~大家好~我有個疑問?" "好奇問一下" "請問BCB" "新手的一個問題......" "我是新手....." "請問一下" 這是我尋找時所發生的錯誤....有高手幫忙一下嗎...小弟真的不會 它說我這個名字沒有預設值..還是我下的程式碼有少用什麼嗎..謝謝 Project Project1.exe raised exception class EOleException with message '參數 宋小俠 沒有預設值。'. Process stopped. Use Step or Run to continue. --------------------------- TADOQuery* qr=DM->Customer; String sql; TEdit* Edit; sql="select * from CUSTOM where 0=0 "; 還有where 0=0 是什麼意思我真的不懂...謝謝高手幫忙一下感恩您.. if (edtName->Text.Trim()!="") { sql =" and ct_name = " edtName->Text " "; } if(edtCompany->Text.Trim() != "") { sql ="and ct_company like \'" edtCompany->Text "%\' "; } if (edtNumber->Text.Trim()!= " ") { sql =" edtNumber like \'" edtNumber->Text "%\' "; } if (edtTel->Text.Trim()!="") { sql =" and ct_tel1 like \'" edtTel->Text "%\'"; } sql = "ORDER BY ct_name"; qr->Close(); qr->SQL->Clear(); qr->SQL->Add(sql); qr->Open();
------
李和樺
stellos
中階會員


發表:24
回覆:84
積分:51
註冊:2004-06-08

發送簡訊給我
#2 引用回覆 回覆 發表時間:2005-03-07 00:33:20 IP:220.138.xxx.xxx 未訂閱
還有where 0=0 我也不曉得 不過可以猜得出來,因此當你的輸入項都沒輸入時 where後沒接語法會錯    sql="select * from CUSTOM where 0=0 ";    if (edtName->Text.Trim()!="") { sql+=" and ct_name = " + edtName->Text + " "; } if(edtCompany->Text.Trim() != "") { sql +="and ct_company like '" + edtCompany->Text + "' "; } if (edtNumber->Text.Trim()!= " ") { sql+=" edtNumber like '" + edtNumber->Text+ "' "; } if (edtTel->Text.Trim()!="") { sql+=" and ct_tel1 like '" + edtTel->Text+ "' "; }  sql += "ORDER BY ct_name";    幫你改了一下試試看吧
leon1019
一般會員


發表:16
回覆:3
積分:3
註冊:2005-02-12

發送簡訊給我
#3 引用回覆 回覆 發表時間:2005-03-07 05:38:15 IP:218.175.xxx.xxx 未訂閱
stellos 還是不行...但感謝你..
------
李和樺
stellos
中階會員


發表:24
回覆:84
積分:51
註冊:2004-06-08

發送簡訊給我
#4 引用回覆 回覆 發表時間:2005-03-08 01:45:00 IP:220.138.xxx.xxx 未訂閱
XXX->Text.Trim()!=NULL 試試 或改成 XXX->Text.Length()>0 還有 你可以Debug時都輸入aaa看String sql是否為 select * from CUSTOM where 0=0 and ct_company like 'aaa' and ct_company like 'aaa' and ct_tel1 like 'aaa' ORDER BY ct_name 如果是這樣應該不會錯ㄚ 檢查字與字間的空格與單引號
系統時間:2024-05-03 20:27:26
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!