and i want to run it from VBA using odbc connection.
What is the best way to use it ?
something like this:
Dim dbCon as new ADODB.Connection
Dim rst as new ADODB.Recordset
Dbcon.connectionstring=”Your connection string goes here!”
Dbcon.open
Rst.open strsql
where strsql is "Select * from totalRecords" or this is not a good solution?
Best,
Jacek
You need the parentheses after the function name: “select * from totalrecords();"
Depends on the usage pattern. I'm sure there is an ODBC construct for stored procedures/function, which you could build once and re-use with new parameter values if you're going to call this repeatedly.