Parameterized Queries - Variables, and Access
- From: Peter Nimmo <PeterNimmo@xxxxxxxxxxxxxxxxx>
- Date: Thu, 30 Nov 2006 03:30:22 -0800
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?
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.
Peter
.
- Follow-Ups:
- Re: Parameterized Queries - Variables, and Access
- From: Bob Barrows [MVP]
- Re: Parameterized Queries - Variables, and Access
- Prev by Date: Re: Returning parameters from an Oracle Procedure (ado & vb6).
- Next by Date: Re: Parameterized Queries - Variables, and Access
- Previous by thread: Returning parameters from an Oracle Procedure (ado & vb6).
- Next by thread: Re: Parameterized Queries - Variables, and Access
- Index(es):
Relevant Pages
|
|