Re: Parameterized Queries - Variables, and Access
- From: "Bob Barrows [MVP]" <reb01501@xxxxxxxxxxxxxxx>
- Date: Thu, 30 Nov 2006 07:14:23 -0500
Peter Nimmo wrote:
Hi,
I usually write ADO code to access SQL Server Databases, but at the
moment I am writing code interfacing with Access 2003 instead.
Normally in situations where two or more SQL statements are needed
that use the same filter in the WHERE condition I declare a variable
using:
DECLARE @VarName <variabletype> SET @VarName = ?
and then I can use @VarName in both sets of WHERE clauses. This
works fine against SQL Server but fails against Access.
I want to delete from two separate tables within the same Command
object. Is there a special syntax to declare variables in Access
specific SQL?
Jet does not support batched statements so the idea of executing two
statements with a single command has to be abandoned.
Do you mean you have this working? Please show us an example.
Otherwise in what way do you solve this problem.
My only other solution at the moment is to use two ? placeholders and
declare two identical Parameters in the Parameters collection.
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
.
- Follow-Ups:
- Re: Parameterized Queries - Variables, and Access
- From: Peter Nimmo
- Re: Parameterized Queries - Variables, and Access
- References:
- Parameterized Queries - Variables, and Access
- From: Peter Nimmo
- Parameterized Queries - Variables, and Access
- Prev by Date: Parameterized Queries - Variables, and Access
- Next by Date: Re: Parameterized Queries - Variables, and Access
- Previous by thread: Parameterized Queries - Variables, and Access
- Next by thread: Re: Parameterized Queries - Variables, and Access
- Index(es):
Relevant Pages
|
|