I am successfully adding stored procedures to an Access database. However,
I need to be able to check if the stored procedure of the same name already
exists.
Is there a way to do this other than waiting for the OleDbException caused
when adding one that already exists?
Here is the code snippet:
Private Sub CreateStoredPro cedures()
Dim alSql As New ArrayList
alSql.Add("CREA TE PROC usp_ProjectResu ltsByID(inID VARCHAR(50)) AS SELECT
* FROM qryResults WHERE ID = inID")
If dbConnection Is Nothing Then
dbConnection = New OleDbConnection (connectionStri ng)
dbCommand = New OleDbCommand
End If
dbCommand.Conne ction = dbConnection
dbConnection.Op en()
Dim i As Integer
For i = 0 To alSql.Count - 1
dbCommand.Comma ndText = DirectCast(alSq l(i), String)
dbCommand.Execu teNonQuery()
Next
dbConnection.Cl ose()
End Sub
Any help is greatly appreciated.
carl