尋找的問題 |
尚未結案
|
leon1019
一般會員 發表:16 回覆:3 積分:3 註冊:2005-02-12 發送簡訊給我 |
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 發送簡訊給我 |
還有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 發送簡訊給我 |
|
stellos
中階會員 發表:24 回覆:84 積分:51 註冊:2004-06-08 發送簡訊給我 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |