gpt4 book ai didi

c++ - const char 到 SQLCHAR 错误

转载 作者:行者123 更新时间:2023-11-28 03:45:33 25 4
gpt4 key购买 nike

SELECT 语句是一个 const char,“query”必须是一个 SQLCHAR* 我试过重新解释转换,但这似乎不起作用。代码运行,即使有这个错误,但我想摆脱这个错误。线路:

SQLCHAR* query = "SELECT tblIP.[IPAddress], tblIP.[IPStatus], tblIP.[IPType] FROM tblIP ORDER BY tblIP.[IPAddress] ASC;";

错误:

IntelliSense: a value of type "const char *" cannot be used to initialize an entity of type "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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com