Results 1 to 3 of 3

Thread: sql server ODBC and SQLSetConnectAttr

  1. #1
    Join Date
    Sep 2002
    Location
    Fantasy
    Posts
    4,254

    sql server ODBC and SQLSetConnectAttr

    RDBMS: SQL Server 2000 + sp4
    Application: xyz

    XYZ connects to SQL Server via ODBC System DSN lets say XYZ_ODBC_DSN. My objective is any connection that uses XYZ_ODBC_DSN should only do uncommited read.

    Any idea how I can do this?

    My application is 3rd party app and I can't change their code and can't changed their procs to have set transaction_isolation level .

    only options I have is
    a. somehow add SQLSetConnectAttr on the connection string
    b. somehow add SQLSetConnectAttr on the ODBC DSN
    c. Somehow update the DLL file that ODBC uses to have SQLSetConnectAttr atrributes hardcoded
    d. Registry hack may be.

    Question is

    a. Is it possible to do this in any of the above 4 options?
    b. If yes, any example we have or anybody knows?

  2. #2
    Join Date
    Sep 2002
    Location
    Fantasy
    Posts
    4,254

  3. #3
    Join Date
    Jun 2007
    Posts
    2
    It depends on the odbc driver. This can be achieved only if the driver supports. Below driver supports this.But i am not sure whether they have driver for MS SQL Server
    http://www.easysoft.com/products/dat...iguration.html

    There are other ways to do this in Unix enviornment using the LD_PRELOAD option with existing driver itself.
    Implement SQLConnect and and if the dsn name matches then set the connection attribute using SQLSetConnectAttr function and then load the actual driver and call SQLConnect.
    It is kind of wrapper to the actual driver where we manipulate something in between and then call the actual driver.
    This wrapper should be put in shared library(.so file) and should be set in LD_PRELOAD enviroment variable.
    google to get more info on this.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •