hi, i'm developping a website under Asp.Net C# with an access database, but i'm having a trouble to use a query that need to verify if some informations exists in the database, if not then insert into the table, but i have the code in sql which is not accepted in access. i want to know if there's another way to make it or if access can use if exist, else if statement: here is the code
i want to know if they can be another to write it.
thanks !
Code:
CREATE PROCEDURE ShoppingCartAjoutProduits
(@CartID char(36),
@ProduitID int,
@Attributs char(255))
As
IF EXISTS
(SELECT CartID
FROM ShoppingCart
WHERE ProduitID = @ProduitID AND CartID = @CartID)
UPDATE ShoppingCart
SET Quantite = Quantite + 1
WHERE ProduitID = @ProduitID AND CartID = @CartID
ELSE
IF EXISTS (SELECT titre FROM livres WHERE NumLivre = @NumLivre)
INSERT INTO ShoppingCart (CartID, ProduitID, Attributs, Quantite, DateAjoute)
VALUES (@CartID, @ProduitID, @Attributs, 1, GETDATE())
thanks !