C++builder,SQL错误
我那天是2013/5/19 ,当时采用了一个做法,结果仍不行。
AnsiString an1;
int i=1;
AnsiString date ="_"+DateToStr(Date());
while(i<date.Length())
{
if(date[i]=='/')
date[i]='_';
i++;
}
an1 = "ALTER TABLE Add_Goods_Table ADD '"+date+"' bigint;";
Menu_QR->SQL->Add(an1);
Menu_QR->Open();
First chance exception at $74F3C41F. Exception class EOleException with message ''_2013_5_19' 附近有语法错误。'. Process Project5.exe (4288) C++Builder SQL error
[解决办法]
an1 = "ALTER TABLE Add_Goods_Table ADD " + date + " bigint;";