1. 버튼 클릭함수 안에서 리턴값이 꼭 발생해야 한다면 변수를 하나 만들어서 저장하세요.
1) 헤더에 int iButtonReturn;
2) 함수에서
uButtonReturn = -1;
return;
2. 수정된 소스 입니다.
void __fastcall TSDIAppForm::Button1Click(TObject *Sender)
{
ganpyunjangbu->Show();
AnsiString m_strPath = ExtractFilePath(ParamStr(0));
AnsiString strMainDBPath;
strMainDBPath = m_strPath +"\MainDB.mdb";
if (FileExists(strMainDBPath))
{
ShowMessage ("MainDB is Exists already!") ;
// return -1;
return;
}
strMainDBPath = "CREATE_DB=\"" + strMainDBPath + "\" General\0";
ShowMessage (strMainDBPath.c_str()) ;
bool bCreated;
bCreated = SQLConfigDataSource(
NULL,
ODBC_ADD_DSN,
"Microsoft Access Driver (*.mdb)",
strMainDBPath.c_str() //"CREATE_DB=c:\\Test.mdb General\0"
);
if (bCreated == true)
{
// return 0;
return;
}
// else return -2;
else return;
}
//--------------------------------------------------------------------------- <</pre></pre>
|