日期:2012-06-21 浏览次数:20566 次
Imports SystemImports System.DataImports System.Data.OleDbModule CreateSP Sub Main() ProductsProcs() End Sub ' Products Stored Procs to be added to the db. Sub ProductsProcs() Dim sSQL As String ' procProductsList - Retrieves entire table sSQL = "CREATE PROC procProductsList AS SELECT * FROM Products;" CreateStoredProc(sSQL) ' procProductsDeleteItem - Returns the details (one record) from the ' JobTitle table sSQL = "CREATE PROC procProductsDeleteItem(@ProductID LONG) AS " _ & "DELETE FROM Products WHERE ProductID = @ProductID;" CreateStoredProc(sSQL) ' procProductsAddItem - Add one record to the JobTitle table sSQL = "CREATE PROC procProductsAddItem(inProductName VARCHAR(40), " _ & "inSupplierID LONG, inCategoryID LONG) AS INSERT INTO " _ & "Products (ProductName, SupplierID, CategoryID) Values " _ & "(inProductName, inSupplierID, CategoryID);" CreateStoredProc(sSQL) ' procProductsUpdateItem - Update one record on the JobTitle table sSQL = "CREATE PROC procProductsUpdateItem(inProductID LONG, " _ & "inProductName VARCHAR(40)) AS UPDATE Products SET " _ & "ProductName = inProductName WHERE ProductID = inProductID;" &n