By default, the Salesforce.com ODBC Driver connects to the Salesforce.com login server, which then connects to your production Salesforce.com server. To connect to your Salesforce.com sandbox, you need to bypass the login server and connect directly. To do this edit or create a new Salesforce.com ODBC Driver data source.
On Windows, create / edit the data source in ODBC Data Source Administrator. You will be changing the Logon URI
attribute value.
On Linux and UNIX, create / edit the data source in odbc.ini, which, by default is located on /etc. You will be changing the URI
attribute value.
Replace "login" in the attribute value with "test". The new URI will look similar to this:
https://test.salesforce.com/services/Soap/u/34