SELECT queries work, INSERT and UPDATE fail?

Discussion in 'ASP General' started by Paul, Jun 23, 2005.

  1. Paul

    Paul Guest

    I have run into a strange problem with a site I am working on. My SELECT
    queries work fine, but I just tried to add an UPDATE statement and it fails.
    A test showed that INSERT fails also. I created a new table just for testing
    called "blah" and it had the same results.

    My statements:
    "UPDATE GiftCerts SET Paid=1 WHERE CertSerial='2005-0001'"
    and
    "INSERT INTO blah (test) VALUES ('something')"

    Here is the error message:

    Microsoft OLE DB Provider for SQL Server error '80040e37'
    Invalid object name 'blah'.

    I do not have admin access, as this is on a shared hosting account. However,
    I have set up many sites under supposedly identical configurations and never
    once had this problem. If it was a permissions issue I would think a
    different error would result?

    Thanks for your help.
    Paul
     
    Paul, Jun 23, 2005
    #1
    1. Advertising

  2. Paul wrote:
    > I have run into a strange problem with a site I am working on. My
    > SELECT queries work fine, but I just tried to add an UPDATE statement
    > and it fails. A test showed that INSERT fails also. I created a new
    > table just for testing called "blah" and it had the same results.
    >
    > My statements:
    > "UPDATE GiftCerts SET Paid=1 WHERE CertSerial='2005-0001'"
    > and
    > "INSERT INTO blah (test) VALUES ('something')"
    >
    > Here is the error message:
    >
    > Microsoft OLE DB Provider for SQL Server error '80040e37'
    > Invalid object name 'blah'.
    >
    > I do not have admin access, as this is on a shared hosting account.
    > However, I have set up many sites under supposedly identical
    > configurations and never once had this problem. If it was a
    > permissions issue I would think a different error would result?
    >
    > Thanks for your help.
    > Paul


    Let's see the code you use to execute these statements.(we don't want to
    plow through your whole page to find the relevant bits - please extract just
    the sections where the statements are built and executed.)
    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.
     
    Bob Barrows [MVP], Jun 23, 2005
    #2
    1. Advertising

  3. Paul

    Paul Guest

    Thanks for the reply.

    I just found the cause. It helps when the connection string is pointing to
    the correct database!! I had copied my connection strings from another
    project and only changed the database and authentication in the one used for
    SELECT queries.

    This ranks as one of the most bone-headed mistakes I've made. Sorry to waste
    your time.

    Paul


    "Bob Barrows [MVP]" <> wrote in message
    news:...
    > Paul wrote:
    >> I have run into a strange problem with a site I am working on. My
    >> SELECT queries work fine, but I just tried to add an UPDATE statement
    >> and it fails. A test showed that INSERT fails also. I created a new
    >> table just for testing called "blah" and it had the same results.
    >>
    >> My statements:
    >> "UPDATE GiftCerts SET Paid=1 WHERE CertSerial='2005-0001'"
    >> and
    >> "INSERT INTO blah (test) VALUES ('something')"
    >>
    >> Here is the error message:
    >>
    >> Microsoft OLE DB Provider for SQL Server error '80040e37'
    >> Invalid object name 'blah'.
    >>
    >> I do not have admin access, as this is on a shared hosting account.
    >> However, I have set up many sites under supposedly identical
    >> configurations and never once had this problem. If it was a
    >> permissions issue I would think a different error would result?
    >>
    >> Thanks for your help.
    >> Paul

    >
    > Let's see the code you use to execute these statements.(we don't want to
    > plow through your whole page to find the relevant bits - please extract
    > just
    > the sections where the statements are built and executed.)
    > --
    > Microsoft MVP -- ASP/ASP.NET
    > Please reply to the newsgroup. The email account listed in my From
    > header is my spam trap, so I don't check it very often. You will get a
    > quicker response by posting to the newsgroup.
    >
    >
     
    Paul, Jun 23, 2005
    #3
  4. Paul

    Roland Hall Guest

    "Paul" wrote in message news:...
    : I just found the cause. It helps when the connection string is pointing to
    : the correct database!! I had copied my connection strings from another
    : project and only changed the database and authentication in the one used
    for
    : SELECT queries.

    FYI... It's either permissions or the table doesn't exist. In this case,
    the latter.

    --
    Roland Hall
    /* This information is distributed in the hope that it will be useful, but
    without any warranty; without even the implied warranty of merchantability
    or fitness for a particular purpose. */
    Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
    WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
    MSDN Library - http://msdn.microsoft.com/library/default.asp
     
    Roland Hall, Jun 23, 2005
    #4
  5. Paul

    Ken Jenkins Guest

    your connection string is pointing to the wrong database



    "Paul" <> wrote in message
    news:...
    >I have run into a strange problem with a site I am working on. My SELECT
    >queries work fine, but I just tried to add an UPDATE statement and it
    >fails. A test showed that INSERT fails also. I created a new table just for
    >testing called "blah" and it had the same results.
    >
    > My statements:
    > "UPDATE GiftCerts SET Paid=1 WHERE CertSerial='2005-0001'"
    > and
    > "INSERT INTO blah (test) VALUES ('something')"
    >
    > Here is the error message:
    >
    > Microsoft OLE DB Provider for SQL Server error '80040e37'
    > Invalid object name 'blah'.
    >
    > I do not have admin access, as this is on a shared hosting account.
    > However, I have set up many sites under supposedly identical
    > configurations and never once had this problem. If it was a permissions
    > issue I would think a different error would result?
    >
    > Thanks for your help.
    > Paul
    >
    >
    >
     
    Ken Jenkins, Jun 27, 2005
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Wenjie

    if (f() != FAIL) or if (FAIL != f())?

    Wenjie, Jul 28, 2003, in forum: C Programming
    Replies:
    3
    Views:
    483
    E. Robert Tisdale
    Jul 31, 2003
  2. Ian Roddis

    xslt queries in xml to SQL queries

    Ian Roddis, Feb 26, 2006, in forum: Python
    Replies:
    3
    Views:
    1,564
    Crutcher
    Feb 26, 2006
  3. Fresno Bob
    Replies:
    0
    Views:
    314
    Fresno Bob
    Nov 24, 2007
  4. Abby Lee

    so many queries within queries I'm confused

    Abby Lee, Aug 4, 2004, in forum: ASP General
    Replies:
    11
    Views:
    381
    Aaron [SQL Server MVP]
    Aug 6, 2004
  5. palmiere
    Replies:
    1
    Views:
    473
    Erwin Moller
    Feb 9, 2004
Loading...

Share This Page