SELECT queries work, INSERT and UPDATE fail?

P

Paul

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
 
B

Bob Barrows [MVP]

Paul said:
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.)
 
P

Paul

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
 
R

Roland Hall

in message : 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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,528
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top