開發平台(Platform): (Ex: VC++, GCC, Linux, ...)
Vs2010 C++
額外使用到的函數庫(Library Used): (Ex: OpenGL, ...)
DAO
問題(Question):
執行到下面程式碼前端有打星號的那行時
會跑出"參數太少預期個數1"的錯誤訊息
餵入的資料(Input):
預期的正確結果(Expected Output):
錯誤結果(Wrong Output):
程式碼(Code):(請善用置底文網頁, 記得排版)
void DataRead(int basetittlemin,int basetittlehour)
{
try{
DAO::DBEngine^ dbEngine;
DAO::Database^ database;
DAO::Recordset^ myRecordset;
DAO::Fields^ myFields;
String^filePath;
int i;
String^ minut;
String^ hou;
if (basetittlemin<10)
{minut="0"+basetittlemin.ToString();}
else
{minut=basetittlemin.ToString();}
if (basetittlehour<10)
{hou="0"+basetittlehour.ToString();}
else
{hou=basetittlehour.ToString();}
dbEngine = gcnew DBEngine();
filePath = hou+minut+"DataChiller.accdb";
database = dbEngine->OpenDatabase(filePath,false,false,"");
String^ ReadSql = "Select Top 60 * From 系統資料 Order By [Id] DESC";
*myRecordset =database->OpenRecordset(ReadSql,DAO::RecordsetTypeEnum::dbOpenDynaset,(int ^)0,DAO::LockTypeEnum::dbOptimistic);
myRecordset->MoveFirst();
database->Close();
}catch (Exception ^DAOException){MessageBox::Show(DAOException->Message, "Error",MessageBoxButtons::OK,
MessageBoxIcon::Error );
}
}
補充說明(Supplement):