title: How do I fix cfWheels ERROR: Wheels.TableNotFound?
body: <p>I am new to Cfwheels and MVC.  Cfwheels website is up and running.<br>
  I have successfully completed <a href="https://guides.cfwheels.org/docs/beginner-tutorial-hello-world" rel="nofollow noreferrer">https://guides.cfwheels.org/docs/beginner-tutorial-hello-world</a> .<br>
  Now I am trying to just test the cfwheels to mySql database connection.  I have NO tables in the mySql database.</p>
  
  <p>The error I get is;</p>
  
  <blockquote>
    <p>Wheels.TableNotFound ttt_shows table could not be found in the
    database.</p>
    
    <p>Suggested action</p>
    
    <p>Add a table named ttt_shows to your database or tell CFWheels to use a
    different table for this model. For example you can tell a user model
    to use a table called tbl_users by creating a User.cfc file in the
    models folder, creating an init method inside it and then calling
    table("tbl_users") from within it.</p>
    
    <p>The ttt_shows table could not be found in the database.
    &lt; 
    Error location: Line 4 in views\ttt_show\cf_info_mysql.cfm ; </p>
  
  <pre><code>&lt;cfset mySqlVerStruct= model("ttt_show").getMySqlVersion1() /&gt;
  </code></pre>
    
    <p>Tag context;  </p>
    
    <p>Error thrown on line 169 in wheels\model\adapters\Base.cfc<br>
     called from line 72 in wheels\model\initialization.cfm<br>
     called from line 1 in root.cfm<br>
     called from line 576 in wheels\global\internal.cfm<br>
     called from line 861 in wheels\global\internal.cfm<br>
     called from line 164 in wheels\global\cfml.cfm<br>
     called from line 14 in wheels\global\cfml.cfm<br>
     called from line 206 in wheels\global\public.cfm<br>
     called from line 4 in views\ttt_show\cf_info_mysql.cfm<br>
     called from line 128 in wheels\global\cfml.cfm<br>
     called from line 434 in wheels\controller\rendering.cfm<br>
     called from line 157 in wheels\controller\rendering.cfm<br>
     called from line 53 in wheels\controller\rendering.cfm<br>
     called from line 141 in wheels\controller\processing.cfm<br>
     called from line 95 in wheels\controller\processing.cfm<br>
     called from line 198 in wheels\dispatch\request.cfm<br>
     called from line 1 in wheels\index.cfm<br>
     called from line 1 in index.cfm<br>
     called from line 1 in wheels\events\onrequest.cfm  </p>
  </blockquote>
  
  <hr>
  
  <p>Note: A related/subpart of my question is; In CfWheels, how do I create a model that does not have an associated database table?  In the future I will need to code a model that does not have a database attached - but does CRUD operations against an xml or json file.
  Thanks in advance for any help / guidance.  </p>
  
  <hr>
  
  <p>So far I have the following code;</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!--- FILE: ..\views\ttt_show.cfm ---&gt;
  &lt;h1&gt;MySql Version Query using;  model("ttt_show").getMySqlVersion1() &lt;/h1&gt;
  
  &lt;cfset mySqlVerStruct= model("ttt_show").getMySqlVersion1() /&gt;
  
  &lt;cfdump var="#mySqlVerStruct#" label="MySql version" /&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;cfcomponent extends="Model"&gt;
    &lt;!--- FILE: ..\models\ttt_show.cfc ---&gt;
    &lt;cffunction name="init"&gt;
    &lt;/cffunction&gt;
  
    &lt;!--- - -   getMySqlVersion1()  - - ---&gt;
    &lt;cffunction name="getMySqlVersion1"&gt;
      &lt;!--- USED BY ..\views\ttt_show\cf_info_mysql.cfm ---&gt;
      &lt;cfset retStruct=S tructNew( "qryMySqlVersion1") /&gt;
      &lt;cfset retStruct.errorStr="" /&gt;
      &lt;cfset retStruct.datasource="#get('dataSourceName')#" /&gt;
      &lt;cfset retStruct.username="#get('dataSourceUserName')#" /&gt;
      &lt;cfset retStruct.password="#get('dataSourcePassword')#" /&gt;
      &lt;cfset retStruct.qry="" /&gt;
      &lt;cfreturn retStruct&gt;
    &lt;/cffunction&gt;
  
    &lt;!--- - -   getMySqlVersion2()  - - ---&gt;
    &lt;cffunction name="getMySqlVersion2"&gt;
      &lt;!--- USED BY ..\views\ttt_show\cf_info_mysql.cfm ---&gt;
      &lt;cfquery name="MySqlVersion2" debug="no" datasource="#APPLICATION.wheels.DATASOURCENAME#" timeout="5"&gt;
        select version() as mysql_version
      &lt;/cfquery&gt;
      &lt;cfreturn MySqlVersion2&gt;
    &lt;/cffunction&gt;
  
    &lt;!--- - -   Create...Table()  - - ---&gt;
    &lt;cffunction name="createEmptyTable"&gt;
      &lt;cfquery result="myCreateTblResults" datasource="#get('dataSourceName')#"&gt;
        CREATE TABLE IF NOT EXISTS `tbl_masters` ( `id` int(11) unsigned NOT NULL auto_increment COMMENT 'unique primary key id', `textValue` varchar(255) default NULL COMMENT 'any text value', `numValue` int(11) default NULL COMMENT 'any numeric value', `dtValue`
        datetime default NULL COMMENT 'any datetime value', `recStatus` tinyint(4) NOT NULL default '1' COMMENT 'Status of This Record', `dtCreated` datetime NOT NULL COMMENT 'date that record was created', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8
        COMMENT='Stores any general key/value pairs for app, MASTER in master-slaves relationship';
      &lt;/cfquery&gt;
  
      &lt;!--- return false: error: not tested yet ---&gt;
      &lt;cfreturn false&gt;
    &lt;/cffunction&gt;
  &lt;/cfcomponent&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;cfcomponent extends="Controller"&gt;&lt;!--- FILE: ..\controllers\ttt_show.cfc ---&gt;
      
   &lt;!--- 
   --- Show debug info / or test a '..\view\*.cfm file.
   ---&gt;
  
   &lt;!--- SEE ..\views\ttt_show\cf_info_mysql.cfm ---&gt;
      &lt;cffunction name="cf_info_mysql"&gt; 
      &lt;/cffunction&gt;    
      
  &lt;/cfcomponent&gt;</code></pre>
  </div>
  </div>
  </p>