473,773 Members | 2,334 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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='200 5-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 3255
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='200 5-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******@NOyah oo.SPAMcom> wrote in message
news:Ok******** ******@tk2msftn gp13.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='200 5-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******** ******@TK2MSFTN GP14.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****@mydomai n.com> wrote in message
news:uM******** ******@tk2msftn gp13.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='200 5-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
3150
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 much data for field' or the query just runs on and on til I have to restart the postmaster. I have found rules to compare mine to but people limit the resulting insert to one record (the WHERE generally limits the result of the SELECT to one...
3
6472
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 COULD be wrong... :) I've tried the access group...twice...and all I get is "Access doesn't like ".", which I know, or that my query names are too long, as there's a limit to the length of the SQL statement(s). But this works when I don't try to...
14
2938
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 relationship. Club has two (2) fields : ClubId (Autonumber) and ClubName (Text). Peoples has two(2) fields : (PersonId (Autonumber) and PersonName (Text) ClubsPersons has two (2) fields : ClubId (LongInteger) and PersonId
1
3689
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 "access_log", the referential integrity triggers generate these queries: SELECT 1 FROM ONLY "public"."application_type" x
29
27607
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 * from #TempPaging I can't provide a reproduceable scenario right now without making this
2
1784
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
12692
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 CSV... same error. I tried the query by itself which worked. As soon as I add the parenthesis and the COPY TO stuff I get the following error: ERROR: syntax error at or near "(" SQL state: 42601 Character: 6 Here's a simple test I devised...
3
1726
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 requested, it is more likely to be up to have a deeper data set (easier to see than describe, but it isn't there yet). In a nutshell, I don't have the resources to go and scour a ton of data, but i've grabbed some starting points, and as the site gets...
6
5637
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) cnn.Open() Dim trx As SqlClient.SqlTransaction = cnn.BeginTransaction() Further suppose that, in the middle of all of the insert/update queries, I want to execute a SELECT query against one of the tables
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10106
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10039
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9914
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8937
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7463
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5355
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4012
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2852
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.