ODBC errors

Using ODBC to connect to another database can be an important requirement, whether the connection is part of the initial data import or an ongoing integration.

There are a couple of error messages that you might experience when using the ODBC connection within DAX, with the main two, often cryptic messages being returned being:

error 1: Microsoft][SQL Server Native Client 10.0][SQL Server]Changed language setting to us_english

error 2: [Microsoft][SQL Server Native Client 10.0]Invalid Descriptor Index

Both of the above errors are caused by the same kind of problem, the extraction of the data. When extracting the data from the ODBC connection you have to extract each field separately , using the position number.

The above errors related to two issues with the field position numbers:

error 1 is caused when you have referenced the same field position twice within your code. So for example you have used field position 2 which is a string with a command like ResultSet.getstring(2). Then before the next record is loaded a call to field position 2 occurs again.

error 2 is caused when you call the returned fields from the SQL statement out of sequence. If you call field 2 before you call field 1, when field 1 is called it will fail with the above error message.

Hopefully this will help with ODBC connection to external databases and resolving some of the typical coding error messages that only occur at run time.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s