1

Is there a way to test if a query exists before trying to execute it. I got the following which works, as long as the query is available (of course) But how can I test if it is available and execute it when it is?

Dim dbCustSpex_ADO As New ADODB.Connection
dbCustSpex_ADO.ConnectionString = CommonAccessMethods.GetConnectionString(PATH_CUSTSPEX)
dbCustSpex_ADO.Open()
dbCustSpex_ADO.Execute("test_upt")
MK01111000
  • 770
  • 2
  • 9
  • 16
  • Try this [SO answer](https://stackoverflow.com/questions/15798284/vb-net-modifying-ms-access-table-name-with-adox), but with .Procedures and .Procedure instead of .Tables and .Table. – Hel O'Ween Oct 26 '21 at 14:43
  • I am new to both VB.net and Acces. I can't see how the link can be used in solving this. – MK01111000 Oct 27 '21 at 04:19
  • Well, you have some reading to do then. What you are trying to do, is retrieving [Schema information](https://docs.microsoft.com/en-us/dotnet/framework/data/adonet/retrieving-database-schema-information) of a database. Specifically: retrieving schema information for [(OLE DB database) procedures](https://docs.microsoft.com/en-us/dotnet/framework/data/adonet/ole-db-schema-collections). Take this [VB.NET sample](https://docs.microsoft.com/en-us/dotnet/framework/data/adonet/getschema-and-schema-collections) for retrieving schema information for Tables and modify it so that it retrieves Procedures – Hel O'Ween Oct 27 '21 at 08:04

0 Answers0