473,385 Members | 1,409 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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 3229
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: jtocci | last post by:
I'm having a big problem with CREATE RULE...ON INSERT...INSERT INTO...SELECT...FROM...WHERE when I want to INSERT several (20~50) records based on a single INSERT to a view. Either I get a 'too...
3
by: Tcs | last post by:
My backend is DB2 on our AS/400. While I do HAVE DB2 PE for my PC, I haven't loaded it yet. I'm still using MS Access. And no, I don't believe this is an Access question. (But who knows? I...
14
by: Jos? | last post by:
This one droves me completely mad. I did not succeed to exploit the track given to me by Bob. I have : three tables : Clubs, Persons and ClubsPersons that join the two first in a many to many...
1
by: Grant McLean | last post by:
Hi First a simple question ... I have a table "access_log" that has foreign keys "app_id" and "app_user_id" that reference the "application_type" and "app_user" tables. When I insert into...
29
by: pb648174 | last post by:
I have the following basic statements being executed: Create a temp table, #TempPaging Insert Into #TempPaging (Col1, Col2) Select Col1, Col2 From SomeOtherTable Order By Col2, Col1 Select...
2
by: Andy B | last post by:
Is there an easy way to convert tableAdaptor queries into stored procs without messing up the dataTables in the dataSet or losing the queries themselves?
2
jlm699
by: jlm699 | last post by:
I'm at the end of my wits here and can't possibly see what I'm doing wrong. I tried doing a "COPY (query) TO '/var/tmp/filename.csv' WITH CSV", which gave me an error. So I tried it w/o the WITH...
3
by: pedalpete | last post by:
I think this is pretty easy to build, but not sure how well it will scale, and therefore if it will actually work. I am trying to attach an indexer to a request so that as a search query gets...
6
by: BobRoyAce | last post by:
Let's say that I am performing a bunch of insert/update queries within a transaction that is created as follows: Dim cnn As New SqlClient.SqlConnection(My.Settings.GRPConnectionString)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.