<i id='cLLXD'><tr id='cLLXD'><dt id='cLLXD'><q id='cLLXD'><span id='cLLXD'><b id='cLLXD'><form id='cLLXD'><ins id='cLLXD'></ins><ul id='cLLXD'></ul><sub id='cLLXD'></sub></form><legend id='cLLXD'></legend><bdo id='cLLXD'><pre id='cLLXD'><center id='cLLXD'></center></pre></bdo></b><th id='cLLXD'></th></span></q></dt></tr></i><div id='cLLXD'><tfoot id='cLLXD'></tfoot><dl id='cLLXD'><fieldset id='cLLXD'></fieldset></dl></div>
  • <small id='cLLXD'></small><noframes id='cLLXD'>

      • <bdo id='cLLXD'></bdo><ul id='cLLXD'></ul>
    1. <tfoot id='cLLXD'></tfoot>
      <legend id='cLLXD'><style id='cLLXD'><dir id='cLLXD'><q id='cLLXD'></q></dir></style></legend>

        SQL 错误:“没有这样的表"

        时间:2023-08-21

        <small id='7Kg56'></small><noframes id='7Kg56'>

          <tbody id='7Kg56'></tbody>

        <legend id='7Kg56'><style id='7Kg56'><dir id='7Kg56'><q id='7Kg56'></q></dir></style></legend>
        • <bdo id='7Kg56'></bdo><ul id='7Kg56'></ul>
          <i id='7Kg56'><tr id='7Kg56'><dt id='7Kg56'><q id='7Kg56'><span id='7Kg56'><b id='7Kg56'><form id='7Kg56'><ins id='7Kg56'></ins><ul id='7Kg56'></ul><sub id='7Kg56'></sub></form><legend id='7Kg56'></legend><bdo id='7Kg56'><pre id='7Kg56'><center id='7Kg56'></center></pre></bdo></b><th id='7Kg56'></th></span></q></dt></tr></i><div id='7Kg56'><tfoot id='7Kg56'></tfoot><dl id='7Kg56'><fieldset id='7Kg56'></fieldset></dl></div>
            1. <tfoot id='7Kg56'></tfoot>
                  本文介绍了SQL 错误:“没有这样的表"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我正在尝试解决为什么我的代码对所有查询都返回 null 的原因,最后发现 sql 查询什么都不返回.我用简约的代码创建了一个新的 AIR 文档 (s:WindowedApplication):

                  I am trying to troubleshoot why my code returned null for all my queries and finally found that sql query returns nothing. I created a new AIR document (s:WindowedApplication) with minimalistic code:

                  <fx:Script>
                          <![CDATA[
                              import mx.events.FlexEvent;
                  
                              private var sqlConnection:SQLConnection;
                              private var select:SQLStatement;
                              private var databaseFile:File;
                  
                              protected function windowedapplication1_creationCompleteHandler(event:FlexEvent):void
                              {
                                  var dbPath:String = "Movie Manager Settings/moovioDB2.db";
                                  databaseFile = File.userDirectory.resolvePath(dbPath);
                                  sqlConnection = new SQLConnection();
                                  select = new SQLStatement();
                  
                                  sqlConnection.addEventListener(SQLEvent.OPEN, onDatabaseOpen);
                                  sqlConnection.openAsync();
                              }
                  
                              private function onDatabaseOpen(event:SQLEvent):void
                              {
                                  select.sqlConnection = sqlConnection;
                                  var query:String = "SELECT title FROM movies";
                                  select.text = query;
                                  select.addEventListener(SQLEvent.RESULT, done);
                                  select.execute();
                              }
                  
                              private function done(event:SQLEvent):void{
                                  var res:SQLResult = select.getResult();
                              }
                  
                          ]]>
                      </fx:Script>
                  

                  除此代码外,只有 Flex 创建的标准标签.执行后,我收到此错误:

                  Other than this code theres is just the standard tags created by Flex. Upon execution I get this error:

                  Error #2044: Unhandled SQLErrorEvent:. errorID=3115, operation=execute , message=Error #3115: SQL Error. , details=no such table: 'movies'
                  

                  我已经用 2 个不同的 sqlite 程序检查了数据库文件并成功执行了查询.电影"表和标题"列都存在.如果重要,电影是 3 个表之一,并且有超过 10 个列都存在值.

                  I have checked the database file with 2 different sqlite programs and executed the query successfully. Both 'movies' table and 'title' column exists. In case it matters movies is one of 3 tables and has over 10 columns all with values present.

                  我做错了什么?我之前使用了相同的代码(我认为)并获得了预期的结果,但现在经过一些更改后,我什至可以在新文档中使用此基本代码.请检查一下,看看我是否犯了一个愚蠢的错误,因为我看不到它:)

                  What am I doing wrong? I used identical code(I thought) before with expected results, but after some changes now I can even get this basic code in a new document to work. Please check it out and see if I am making a stupid mistake because I can't see it :)

                  推荐答案

                  你能验证你打开的数据库的路径是你用外部工具检查过的那个文件吗?您可以在 AS3 代码中使用 database_list pragma.就像执行任何其他 SQL 语句一样执行它:

                  Can you verify that the path of the database you open is the one of that file you checked with external tools? You can use the database_list pragma from within you AS3 code. Just execute it as any other SQL statement:

                  [user@host ~]$ cd /tmp
                  [user@host tmp]$ sqlite3 foo.db
                  SQLite version 3.7.11 2012-03-20 11:35:50
                  Enter ".help" for instructions
                  Enter SQL statements terminated with a ";"
                  sqlite> pragma database_list;
                  0|main|/tmp/foo.db
                  

                  这篇关于SQL 错误:“没有这样的表"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:如何使用 Flex 更新 MySql 数据库 下一篇:SQLite - 创建加密数据库.怎么……?

                  相关文章

                  最新文章

                • <i id='M3PFF'><tr id='M3PFF'><dt id='M3PFF'><q id='M3PFF'><span id='M3PFF'><b id='M3PFF'><form id='M3PFF'><ins id='M3PFF'></ins><ul id='M3PFF'></ul><sub id='M3PFF'></sub></form><legend id='M3PFF'></legend><bdo id='M3PFF'><pre id='M3PFF'><center id='M3PFF'></center></pre></bdo></b><th id='M3PFF'></th></span></q></dt></tr></i><div id='M3PFF'><tfoot id='M3PFF'></tfoot><dl id='M3PFF'><fieldset id='M3PFF'></fieldset></dl></div>
                  <legend id='M3PFF'><style id='M3PFF'><dir id='M3PFF'><q id='M3PFF'></q></dir></style></legend>

                  <tfoot id='M3PFF'></tfoot>

                  1. <small id='M3PFF'></small><noframes id='M3PFF'>

                      <bdo id='M3PFF'></bdo><ul id='M3PFF'></ul>