none
System.Data.OleDb.OleDbException (0x80004005) RRS feed

  • Question

  • Hi

    I open a db connection to a local MS Access db via oledb and execute queries that involve a remote SQL Server. The queries are of type;

    INSERT INTO [ODBC;Driver=SQL Server;SERVER=xxx.xxx.xxx.xxx;DATABASE=MySQLServerDatabase;UID=MyUser;PWD=MyPassword].MySQLServerTable ( <field list> ) 
    SELECT <field list>
    FROM MyMSAcessTable
    WHERE ...

    This was working fine for a long time. Suddenly on cmd.ExecuteNonQuery for queries that involve remote SQL Server I have started to get below error;

    System.Data.OleDb.OleDbException (0x80004005): ODBC--connection to 'SQL Serverxxx.xxx.xxx.xxx' failed

    The queries refer to two separate remote SQL Servers (not in the same query) and I am getting error on both SQL Servers. What has gone wrong and how can I fix it?

    Thanks

    Regards
    Wednesday, May 21, 2014 1:08 AM

All replies

  • Hello Yayhya,

    I am helping look into this case.

    >>What has gone wrong and how can I fix it?

    It is so hard to tell what has gone wrong since it works all fine with the same thing before.

    Have you done anything to update some of your components? If have, please have a try to downgrade and check whether it could work. And if it works, then I think the new component may be incompatible.

    >> The queries refer to two separate remote SQL Servers (not in the same query) and I am getting error on both SQL Servers

    Does it work fine if you rebuild and re-open the application? If it is, then I think we can focus on the project, the caused reason may be there.

    Or do you have a try to connect to a new sqlserver with same schema, if it works, then I think the two sqlsevers may go wrong, you need to ask your DBA to check them.

    Above is my suggestions to isolate the issue, you can have a try, if this does not work for you, please let me know.

    Regards.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, May 21, 2014 9:24 AM
    Moderator
  • Hi Fred

    >> Have you done anything to update some of your components? 

    No.

    >> Does it work fine if you rebuild and re-open the application? 

    No. I even reinstalled access engine (ACE) in case that was corrupt but no luck. When I moved the same project to another machine (a Win 7 64 bit pc) then I simply had to install ACE engine and project worked without any change.

    This to me seems to suggest that something has gone wrong with the original Win 2008 R2 server. Not sure what though. 

    Thanks

    Regards

    Wednesday, May 21, 2014 3:23 PM
  • Hello,

    Please check this link which help you in troubleshooting the OleDbException:

    http://msdn.microsoft.com/en-us/library/6y8t7kbw.aspx

    Regards.

    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, May 22, 2014 8:42 AM
    Moderator