Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > SELECT queries work, INSERT and UPDATE fail?

Reply
Thread Tools

SELECT queries work, INSERT and UPDATE fail?

 
 
Paul
Guest
Posts: n/a
 
      06-23-2005
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



 
Reply With Quote
 
 
 
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      06-23-2005
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.


 
Reply With Quote
 
 
 
 
Paul
Guest
Posts: n/a
 
      06-23-2005
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]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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.
>
>



 
Reply With Quote
 
Roland Hall
Guest
Posts: n/a
 
      06-23-2005
"Paul" wrote in message news:(E-Mail Removed)...
: 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


 
Reply With Quote
 
Ken Jenkins
Guest
Posts: n/a
 
      06-26-2005
your connection string is pointing to the wrong database



"Paul" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>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
>
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dataset wizard only produces select and insert queries Fresno Bob ASP .Net 0 11-24-2007 04:10 PM
xslt queries in xml to SQL queries Ian Roddis Python 3 02-26-2006 06:49 PM
Updating dataset for SELECT queries Al Wilkerson ASP .Net 0 09-18-2004 03:36 AM
so many queries within queries I'm confused Abby Lee ASP General 11 08-06-2004 07:56 PM
select of select box will select multiple in another box palmiere Javascript 1 02-09-2004 01:11 PM



Advertisments