PeterK
June 3rd, 1999, 12:54 PM
I have an MS Access database that contains one table. The table has two indexes: the primary key and an additional index. Both indexes contain multiple fields. I am using the ODBC API to access the database.
My select statement looks like one of these statements depending on which key should be used.
strSQLString.Format("SELECT "
"[INSTITUTION ID],"
"[DOCUMENT ACCOUNT],"
"[PROCESSOR ACCOUNT]"
" FROM accimage WHERE "
"[Institution ID] = ? AND "
"[Document Account] = ? ");
or
strSQLString.Format("SELECT "
"[INSTITUTION ID],"
"[DOCUMENT ACCOUNT],"
"[PROCESSOR ACCOUNT]"
" FROM accimage WHERE "
"[Institution ID] = ? AND "
"[Processor Account] = ? ");
How do I tell ODBC which index to use or does it happen automatically? This section of code happens to be very time critical and the use of the proper index will be important. Is it possible to designate which index to use through the ODBC API?
My select statement looks like one of these statements depending on which key should be used.
strSQLString.Format("SELECT "
"[INSTITUTION ID],"
"[DOCUMENT ACCOUNT],"
"[PROCESSOR ACCOUNT]"
" FROM accimage WHERE "
"[Institution ID] = ? AND "
"[Document Account] = ? ");
or
strSQLString.Format("SELECT "
"[INSTITUTION ID],"
"[DOCUMENT ACCOUNT],"
"[PROCESSOR ACCOUNT]"
" FROM accimage WHERE "
"[Institution ID] = ? AND "
"[Processor Account] = ? ");
How do I tell ODBC which index to use or does it happen automatically? This section of code happens to be very time critical and the use of the proper index will be important. Is it possible to designate which index to use through the ODBC API?