none
Issue with reconnect to the database RRS feed

  • Question

  • Hi,


    My application (written in C) can successfully connect to the remote database (PostgreeSQL v8.2).

     
    (Server running on Windows 2000, Local machine running on Windows XP SP2 Pro)

     
    After I restart the database (PostgreeSQL) on the remote Server the application cannot reconnect, the
    SQLConnect Function returns the following error:  

     
    SqlState:IM002 NativeError:0 Msg:[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified.

     
    Database is definitly up and running as I can connect to it using psql.

     
    I’m freeing all handles and the connection before attempting to reconnect to the database.

     
    SQLFreeHandle(SQL_HANDLE_STMT,hstmt);                 
    SQLDisconnect(hDbc);             
    SQLFreeHandle(SQL_HANDLE_DBC,hDbc);                   
    SQLFreeHandle(SQL_HANDLE_ENV,hEnv);


    If the application is restarted it connects to the database without a problem.




    Tuesday, June 5, 2007 12:43 PM

Answers