SELECT语句是一个const char,“ query”必须是SQLCHAR*
,我试图重新解释强制类型转换,但这似乎不起作用。即使有此错误,代码也会运行,但我想摆脱该错误。该行:
SQLCHAR* query = "SELECT tblIP.[IPAddress], tblIP.[IPStatus], tblIP.[IPType] FROM tblIP ORDER BY tblIP.[IPAddress] ASC;";
错误:
IntelliSense:类型“ const char *”的值不能用于初始化类型“ SQLCHAR *”的实体
最佳答案
SQLCHAR* query = (SQLCHAR *)"SELECT tblIP.[IPAddress], tblIP.[IPStatus], tblIP.[IPType] FROM tblIP ORDER BY tblIP.[IPAddress] ASC;";
关于c++ - const char到SQLCHAR错误,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/7812057/