469,644 Members | 1,943 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,644 developers. It's quick & easy.

SELECT queries work, INSERT and UPDATE fail?

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

Jul 22 '05 #1
4 3096
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.
Jul 22 '05 #2
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]" <re******@NOyahoo.SPAMcom> wrote in message
news:Ok**************@tk2msftngp13.phx.gbl...
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.

Jul 22 '05 #3
"Paul" wrote in message news:Oi**************@TK2MSFTNGP14.phx.gbl...
: 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
Jul 22 '05 #4
your connection string is pointing to the wrong database

"Paul" <no****@mydomain.com> wrote in message
news:uM**************@tk2msftngp13.phx.gbl...
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

Jul 22 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Tcs | last post: by
14 posts views Thread by Jos? | last post: by
29 posts views Thread by pb648174 | last post: by
6 posts views Thread by BobRoyAce | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.