Insert Into Picture Values(PictureFile,PictureFile,ModelName)";
呵呵,SQL 语句怎么可以那么写? strSQL.Format("select * from Picture where PicFile=%s",PictureFile); 这样才将参数传给了SQL 语句 我想后面的也一样了!
后面的怎么写呢?? strSQL.Format("Insert Into Picture values('%s,%s,%s',PictureFile,PictureFile,ModelName)");程序中调用有 PicFileName=22-H85-0.bmpt 出错信息为 Line1:Incorrect syntax near 'bmpt'. Statemen(s) could not be prepared.什么问题,求助!
strSQL.Format("Insert Into Picture values(\'%s,%s,%s\',PictureFile,PictureFile,ModelName)"); 另,这个问题主要是变量名在SQL中的用法,其实你在单步调试的时候看一下SQL语句的值,在查询分析器里分析一下就知道错在那里了
是啊,这位老兄,在VC++中最基本的RecordSet语句, strSQL.format("Insert Into Picture values(\'%s\',\'%s\',\'%s\'),PictureFile,PictureFile,ModelName"); m_database.ExecuteSQL(strSQL); 其实可以先在查询分析器里调试一下你的SQL语句
strSQL.Format("select * from Picture where PicFile=%s",PictureFile);
这样才将参数传给了SQL 语句
我想后面的也一样了!
strSQL.Format("Insert Into Picture values('%s,%s,%s',PictureFile,PictureFile,ModelName)");程序中调用有
PicFileName=22-H85-0.bmpt
出错信息为
Line1:Incorrect syntax near 'bmpt'.
Statemen(s) could not be prepared.什么问题,求助!
另,这个问题主要是变量名在SQL中的用法,其实你在单步调试的时候看一下SQL语句的值,在查询分析器里分析一下就知道错在那里了
strSQL.format("Insert Into Picture values(\'%s\',\'%s\',\'%s\'),PictureFile,PictureFile,ModelName");
m_database.ExecuteSQL(strSQL);
其实可以先在查询分析器里调试一下你的SQL语句