Group:  Microsoft Access ยป microsoft.public.access.odbcclientsvr
Thread: Trying to delete in a passthru query

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

Trying to delete in a passthru query
Max Yaffe <myaffe[ at ]not.gamry.com> 03.08.2006 15:08:12
Dear Group,

I'm trying to create a passthrough query to delete a set of records in
a SQL server table. I've tried using MDB/ODBC/DAO and using ADP/ADO
without success.

Here's the query:
DELETE dbo.tblInventoryValue.Part
FROM dbo.tblInventoryValue;

Executing this results in an ODBC - Call failed. ..."Invalid object
name 'dbo.tblInventoryValue.Part'


When I turn it into a select query, it works fine.

I think I have full delete permission on this database.
I tried using the SQL Profiler but the results were unenlightening.

Any ideas?

Thanks,
Max
Re: Trying to delete in a passthru query
"Brendan Reynolds" <brenreyn[ at ]discussions.microsoft.com> 03.08.2006 16:02:57
A DELETE statement should not include any column name(s) ...

DELETE FROM dbo.tblInventoryValue;

Be careful with this - this will delete *all* rows in that table. Are you
sure that's what you want to do? Even if you are sure, have you made a
backup, just in case?

--
Brendan Reynolds
Access MVP

"Max Yaffe" <myaffe[ at ]not.gamry.com> wrote in message
news:fv34d2p69i80sm02qgt3gk1etaueufrn1f[ at ]4ax.com...
[Quoted Text]
> Dear Group,
>
> I'm trying to create a passthrough query to delete a set of records in
> a SQL server table. I've tried using MDB/ODBC/DAO and using ADP/ADO
> without success.
>
> Here's the query:
> DELETE dbo.tblInventoryValue.Part
> FROM dbo.tblInventoryValue;
>
> Executing this results in an ODBC - Call failed. ..."Invalid object
> name 'dbo.tblInventoryValue.Part'
>
>
> When I turn it into a select query, it works fine.
>
> I think I have full delete permission on this database.
> I tried using the SQL Profiler but the results were unenlightening.
>
> Any ideas?
>
> Thanks,
> Max


Re: Trying to delete in a passthru query
Max Yaffe <myaffe[ at ]not.gamry.com> 03.08.2006 17:55:03
Thanks, Brendan.
Yes, I am trying to delete everything. Sometime later I'm going to
want to delete matching records so if a simple "WHERE X = Y" doesn't
work, I might be back to you.
Max

On Thu, 3 Aug 2006 17:02:57 +0100, "Brendan Reynolds"
<brenreyn[ at ]discussions.microsoft.com> wrote:

[Quoted Text]
>A DELETE statement should not include any column name(s) ...
>
>DELETE FROM dbo.tblInventoryValue;
>
>Be careful with this - this will delete *all* rows in that table. Are you
>sure that's what you want to do? Even if you are sure, have you made a
>backup, just in case?

Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net