這麼新增 new record to .db |
答題得分者是:brook
|
santoso741852963
一般會員 發表:1 回覆:0 積分:0 註冊:2010-08-24 發送簡訊給我 |
因為對bcb不太熟, 我想請問一下這麼新增new record to .db檔
TTable* Table = new TTable(NULL); Table->Active = false; Table->TableType = ttParadox; Table->TableName = "Category.db"; Table->FieldDefs->Clear(); Table->FieldDefs->Add("CategoryID", ftInteger, 0, FALSE); Table->FieldDefs->Add("Name", ftString, 32, FALSE); Table->IndexDefs->Clear(); Table->IndexDefs->Add("Index1", "CategoryID", TIndexOptions()<< ixPrimary << ixUnique ); Table->CreateTable(); Table->Free(); 下一個步驟是?......如要: id: 1234 Name: james id: 4321 Name: david id: 8473 Name: Shane 謝謝大家
------
葉科紅 |
brook
資深會員 發表:57 回覆:323 積分:371 註冊:2002-07-12 發送簡訊給我 |
[code cpp] 請在此區域輸入程式碼 Table = new TTable(NULL); Table->Active = false; Table->TableType = ttParadox; Table->TableName = "Category.db"; Table->FieldDefs->Clear(); Table->FieldDefs->Add("CategoryID", ftInteger, 0, FALSE); Table->FieldDefs->Add("Name", ftString, 32, FALSE); Table->IndexDefs->Clear(); Table->IndexDefs->Add("Index1", "CategoryID", TIndexOptions()<< ixPrimary << ixUnique ); Table->CreateTable(); // Table->Free(); Table->Open(); Table->Append(); Table->FieldByName("CategoryID")->AsString = "4321"; Table->FieldByName("Name")->AsString = "david"; Table->Append(); Table->FieldByName("CategoryID")->AsString = "8473"; Table->FieldByName("Name")->AsString = "Shane"; [/code] |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |