ODBC: Function sequence error.

I recently ran into an error like this yesterday:

ERROR [HY010] [Microsoft][ODBC
SQL Server Driver]Function sequence error

Turns out, it was a simple fix. My query was essentially

use DatabaseName
select * from table

All I had to do was remove the ‘use DatabaseName’ line and everything worked well.


~ by ra1ndog on June 11, 2009.

One Response to “ODBC: Function sequence error.”

  1. Query batches. Live ’em, love ’em, learn ’em. If you really wanted the use in there, instead of having it in connect string or default database, this probably would work:

    use DatabaseName
    select * from table

    Would return two of those ODBC recordsets and you’d have to use the weird getnextrecordset (or whatever, it’s been years) to get past the first empty one, which is the output of the use statement.

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s

%d bloggers like this: