Delete Query

L

Lou

Hello All,
I have a delete query that I use to delete items from my
database. I have upsized my database to ADP project and
the query will not work, I am hoping that someone will
instruct me on how to create this query as a Store
Procedure. Below I have included what the query looks
like and also the SQL information.. I hope someone can
help or direct me to a resource that can.
Thank you..

Field: MasterData.* | Expr1:MasterData.circuitid |
circuitid
Table: MasterData | |
MasterData
Delete: From | Where |
Where
Criteria: |
[forms]![frmAdmin]![circuitid]

DELETE MasterData.*, MasterData.lcircuitid AS Expr1,
MasterData.circuitid
FROM MasterData
WHERE (((MasterData.circuitid)=[forms]![frmAdmin]!
[circuitid]));
 
M

MGFoster

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

ADP's use SQL Server (or MSDE) which means the syntax for a DELETE is:

DELETE FROM MasterData
WHERE circuitid=@CircuitID

You will have to put this into a stored procedure (SP), 'cuz you can't
reference a form as a parameter ([forms]![frmAdmin]![circuitid]).

See the SQL books on line (BOL) for further info on creating SPs. Hint:

CREATE PROCEDURE usp_DeleteCircuit @CircuitID INTEGER
AS
DELETE FROM MasterData
WHERE circuitid = @CircuitID

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQRvF5IechKqOuFEgEQLCJgCgovgsh4kdwI3Hts53Vmn18LgMjRAAoLjg
TOTF6HqjS0jEr+t7kWWYGWl9
=moHr
-----END PGP SIGNATURE-----
 
G

Guest

MG,
Thank you, it works great..
-----Original Message-----
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

ADP's use SQL Server (or MSDE) which means the syntax for a DELETE is:

DELETE FROM MasterData
WHERE circuitid=@CircuitID

You will have to put this into a stored procedure (SP), 'cuz you can't
reference a form as a parameter ([forms]![frmAdmin]! [circuitid]).

See the SQL books on line (BOL) for further info on creating SPs. Hint:

CREATE PROCEDURE usp_DeleteCircuit @CircuitID INTEGER
AS
DELETE FROM MasterData
WHERE circuitid = @CircuitID

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQRvF5IechKqOuFEgEQLCJgCgovgsh4kdwI3Hts53Vmn18LgMj RAAoLjg
TOTF6HqjS0jEr+t7kWWYGWl9
=moHr
-----END PGP SIGNATURE-----

Hello All,
I have a delete query that I use to delete items from my
database. I have upsized my database to ADP project and
the query will not work, I am hoping that someone will
instruct me on how to create this query as a Store
Procedure. Below I have included what the query looks
like and also the SQL information.. I hope someone can
help or direct me to a resource that can.
Thank you..

Field: MasterData.* | Expr1:MasterData.circuitid |
circuitid
Table: MasterData | |
MasterData
Delete: From | Where |
Where
Criteria: |
[forms]![frmAdmin]![circuitid]

DELETE MasterData.*, MasterData.lcircuitid AS Expr1,
MasterData.circuitid
FROM MasterData
WHERE (((MasterData.circuitid)=[forms]![frmAdmin]!
[circuitid]));

.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top