本文介绍了无法创建表;为什么这段代码会失败?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在使用 SQLite v3.22.0 和 AutoIt v3.3.14.3 时遇到问题.尝试创建数据库有效,但未创建表.我使用 AutoIt 示例代码:
I have a problem with SQLite v3.22.0 and AutoIt v3.3.14.3. Trying to create a database works but the table does not get created. I use the AutoIt example code:
#include <MsgBoxConstants.au3>
#include <SQLite.au3>
#include <SQLite.dll.au3>
Local $hQuery, $aRow, $sMsg
_SQLite_Startup()
ConsoleWrite("_SQLite_LibVersion=" & _SQLite_LibVersion() & @CRLF)
_SQLite_Open() ; open :memory: Database
_SQLite_Exec(-1, "CREATE TABLE aTest (a,b,c);") ; CREATE a Table
_SQLite_Exec(-1, "INSERT INTO aTest(a,b,c) VALUES ('c','2','World');") ; INSERT Data
_SQLite_Exec(-1, "INSERT INTO aTest(a,b,c) VALUES ('b','3',' ');") ; INSERT Data
_SQLite_Exec(-1, "INSERT INTO aTest(a,b,c) VALUES ('a','1','Hello');") ; INSERT Data
_SQLite_Query(-1, "SELECT c FROM aTest ORDER BY a;", $hQuery) ; the query
While _SQLite_FetchData($hQuery, $aRow) = $SQLITE_OK
$sMsg &= $aRow[0]
WEnd
_SQLite_Exec(-1, "DROP TABLE aTest;") ; Remove the table
MsgBox($MB_SYSTEMMODAL, "SQLite", "Get Data using a Query : " & $sMsg)
_SQLite_Close()
_SQLite_Shutdown()
; Output:
; Hello World
如果我请求 SQLite 错误,我会收到库使用不正确".这种情况有什么问题?
If I request the SQLite error, I get "Library used incorrectly". What's the problem in this case?
推荐答案
AutoIt v3.3.14.3 有一个错误;安装 AutoIt v3.3.14.2 或 获取错误修复.
AutoIt v3.3.14.3 has a bug; install AutoIt v3.3.14.2 or get the bug-fix.
这篇关于无法创建表;为什么这段代码会失败?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!