Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7248743
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T22:10:49+00:00 2026-05-28T22:10:49+00:00

After upgrading from Cake 1.3 to 2.0 I I’m getting missing table errors for

  • 0

After upgrading from Cake 1.3 to 2.0 I I’m getting missing table errors for all my models that use database views rather than tables. My models using tables still work fine. Changing these models to use tables fixes the problem, but I need views.

In the past this worked, as this question shows; views worked just like tables. However after moving to Cake 2.0 I get:

Error: Database table myView for model myModel was not found

Here’s an example Model class:

class Hauler extends AppModel
{
    var $useTable = 'hauler_view';
    var $primaryKey = 'id';
    var $useDbConfig = 'default';
}

The view hauler_view exists and worked in the app in 1.3. Copying the same data from the view into a physical table will work if I set the model to read that physical table instead.

I’ve confirmed I can access database views via Cake’s raw SQL functions, so I can access those views, it’s just that the Models aren’t seeing the “tables”.

I’m using SQL Server 2005 with the sqlsrv driver if that matters. I have the SQL Server 2008 Native Client installed on my server which allows this version of cake to access SQL Server.

Is there some way to let Models in CakePHP 2.0 use views rather than tables?

I solved this related problem so I now know my database driver is functioning properly and is not the problem.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T22:10:50+00:00Added an answer on May 28, 2026 at 10:10 pm

    This is an Open Bug in the Cake PHP 2.0 branch, the bug affects SQL Server only and doesn’t allow models to use SQL Server views. It’s slated to be fixed in Cake release 2.0.6.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

After upgrading a project from Flex4 Beta1 to Beta2, I've found that the background-image
After upgrading to new Android tools, I am getting following warnings from Proguard: Warning:
After upgrading from Firefox 3.6 to FF4 i was surprised to see that jQuery
After upgrading my copy of xcode from 3.2.2 to 3.2.3, I am getting over
After upgrading a project from Delphi 2007 to Delphi 2009 I'm getting an Unknown
I can't understand why I'm not getting a DataIntegrityViolationException any more after upgrading from
After upgrading Eclipse from Helios to Indigo with EGit plugin 1.0.0, all my projects
After upgrading to Magento 1.6.2.0 (from 1.4) the product_option field in table sales_flat_order_item doesn’t
After upgrading from Spring 3.0.0.M4 to 3.0.0.RC1 and Spring Security 3.0.0.M2 to 3.0.0.RC1, I've
After upgrading Perl, I receive some errors in a Perl CGI script: Unquoted string

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.