Deleting stored procedures with code (ADOX)

Deleting stored procedures with code (ADOX)

Post by awy.. » Mon, 24 Jan 2000 04:00:00



Hi

I've recently started moving from Dao to ADO and have hit a few
problems with creating/deleting stored procedures (in an Access
database).

I've figured out how to create the stored procedures from code using
the ADOX Catalog and Procedures.Append methods and the ADODB
CommandText.

Now I want to be able to delete the stored procedures. I thought I
could do this through the Procedures.Delete(item). Fair enough this
deletes a stored procedure when it exists in the collection, but
something weird is happening. The Procedures collection doesn't contain
a collection of all the procedures I created.

Out of the 8 I create, only 7 are in the collection, concidentally,
it's the first procedure I created that's missing. I rerun the deletion
function again and this time only 6 procedures are in the collection,
again the first one is missing. This ends up with some procedures I
can't delete, and subsequently can't recreate because they already
exist error message is fired back at me.

I'm not cycling through the collection on an index basis, but using

For Each objProcedure in objCatalog.Procedures
    'Deletion code
Next

so there's no incorrect indexing being used. Can anyone throw any light
on this?

Thanks
Andrew

Sent via Deja.com http://www.deja.com/
Before you buy.

 
 
 

Deleting stored procedures with code (ADOX)

Post by awy.. » Tue, 25 Jan 2000 04:00:00




> Hi

> I've recently started moving from Dao to ADO and have hit a few
> problems with creating/deleting stored procedures (in an Access
> database).

......

Hi,

Can't remember/find how to cancel this post but I've found a solution
to this, basically my lack of ADO knowledge. ADO is smart enough to
realise that of the queries I'm creating, some of them are actually
views, i.e. no parameters in them. Therefore, when I request the
adSchemaProcedures info, the 'view' queries are not included.

I now use adSchemaViews to get at the other queries.

Thanks
Andrew

Sent via Deja.com http://www.deja.com/
Before you buy.