我设置了MySQL路径,但仍然得到相同的错误.请告诉我是否遵循了正确的方法.
MySQL的位置是: C:\Program Files\MySQL\MySQL Server 5.0\bin
在Windows中,系统变量我将路径设置为:
MYSQL_HOMEC:\Program Files\MySQL\MySQL Server 5.0\bin对于PATH设置:
PATH.;%JAVA_HOME%\bin;%MYSQL_HOME%\bin...如果它不正确,请告诉我正确的路径及其设置.
下面是VC++中的插入函数.当我将char更改为字符串数据类型以读取以下代码中的amount变量值时,我收到此错误.
static void Insert(t_analysis* analysis)
{
_bstr_t strunitId;
_bstr_t strGdt=time(0);
_bstr_t strvalue;
std::string str;
std::string commandStr = "insert into table1(unitid,g_time_dte_1,h_1,n_1,ch_1,co_1,im_1,ve_1,er_1) Values(123,'" + strGdt +"',";
char tempBuf[50];
for (int j = 0; j < analysis->ubPeaksIntTab;j++ )
{
sprintf(tempBuf, "%d", (analysis->peak + j)->amount);//here it takes the adrress of amount but not the value of amount variable.
str += commandStr + tempBuf;
if(j!=analysis->ubPeaksIntTab-1)
commandStr += ",";
}
commandStr += ")";
_ConnectionPtr pConn = NULL;
try
{
HRESULT hr = S_OK;
CoInitialize(NULL);
hr = …Run Code Online (Sandbox Code Playgroud)