I should mention that I am working with Access 2003 and Borland Builder 6.0 Professional.
For my experience so far I believe the following to be true:
- There is no way to setup an ADO connection in ODBC (I could be wrong in this but it is not clearly obvious how one would set it up.)
- Procedures can be created and destroyed. In TQuery they can only be created.
The following test code compiled and ran and worked.
#include
TADOConnection *conn = new TADOConnection( NULL );
conn->ConnectionString =
"Provider=Microsoft.Jet.OLEDB.4.0;"
"Data Source=C:\\LU_IncomingQC_APB.mdb;"
"Persist Security Info=False" ;
conn->Open();
TADOQuery *qry = new TADOQuery( NULL );
qry->Connection = conn;
// Create the procedure to be called
sql = "CREATE PROC createTable "
" (NewTable TEXT) AS "
" CREATE TABLE NewTable "
" ( "
" InvoiceID INTEGER NOT NULL, "
" InvoiceDate DATETIME NOT NULL "
" ); ";
sql = "CREATE PROCEDURE DeleteInvoices AS (DROP TABLE testTable1)";
qry->SQL->Clear();
qry->SQL->Add( sql );
qry->ExecSQL();
sql = "DROP PROC DeleteInvoices;";
qry->SQL->Clear();
qry->SQL->Add( sql );
qry->ExecSQL();
normal