ODBC 2.0 Drivers Use the MID() Scalar Function

Last reviewed: September 12, 1996
Article ID: Q135796
The information in this article applies to:
  • Microsoft Excel for Windows, versions 5.0, 5.0c
  • Microsoft Excel for Windows NT, version 5.0
  • Microsoft ODBC Desktop Database Drivers, version 2.0
  • Microsoft Excel for Windows 95, version 7.0

SUMMARY

The ODBC 2.0 Help file, Odbcjet.hlp, incorrectly lists the SUBSTRING() scalar function as a supported function of the Open Database Connectivity (ODBC) drivers shipped in the Microsoft ODBC Desktop Database Drivers Kit, version 2.0. The MID() function replaces the SUBSTRING() function and should be listed instead of SUBSTRING() as a supported scalar function.

MORE INFORMATION

The ODBC 1.0 drivers shipped in the Microsoft ODBC Fulfillment Kit use the SUBSTRING() scalar function to return a specific number of characters from a text string, starting at a position you specify.

The ODBC 2.0 drivers now use the MID() function to perform the same function and it uses the same syntax as the SUBSTRING() function. The syntax for the MID() function is shown below:

   MID(text,start_num,num_chars)

For example, assume we have the text string "Hello World." To return the "World" string, use the following function:

   MID("Hello World",7,5)

If you try to use the SUBSTRING() function with an ODBC 2.0 driver, you may receive the following error message:

   Undefined function 'substring' in expression.

REFERENCES

For more information on Scalar functions, click the Index tab in Jet Engine Error Help (open the Odbcjet.hlp Help file in the Windows\System folder), type the following text

   scalar functions

and then double-click the selected text to go to the "Scalar Functions" topic.


KBCategory: kbtool
KBSubcategory:

Additional reference words: 2.00



THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: September 12, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.