Accessing 4D database with .NET odbc data provider RRS feed

  • Question

  • I am currently trying to integrate two .net applications (winforms and ASPX) with my companies currently working 4D solution. I have installed 4D's ODBC driver and have had very mixed results connecting to 4D with my applications. I am experiencing lots of "communication link failure" and "Server rejected the connection" errors. With the winforms app I worked closely with our 4D developer. After many failed attempts to create a reliable connection (i.e. open connection, execute statement, close connection) we tried an 'always open' connection. The ‘always open’ connection being a connection I open at the start of the application and close once the application has closed. In doing this the reliability came to an almost expectable level. Obviously this isn’t case closed as this approach brings with it many additional issues one of which being trying to close the connection successfully when the winforms app fails for non-data related issues.

    Now fast forward to today and I am working to integrate an aspx solution and I’m having no success. I had a connection work once but any subsequent requests failed. I tried restarting my development machine and got the connection to work once more (not happiness). I’ve since gone from using code behind and odbc objects to creating a datasource via visual studios built-in tools and it is having the same issues.

    My question is, have any of you had any success in developing solution based on a 4D back end with a .net front end? If so, could you make a suggestion of what I should try next?


    Wednesday, December 22, 2010 9:33 PM

All replies


    Welcome to MSDN forums.

    According to your description, you are using 4D's ODBC driver to connect your 4D database, Would you please tell us what data provider are you using? Actually, I am not familiar with 4D's ODBC driver, you may visit 4D's tech Support.The link is here: .


    Have a nice day.

    Alan Chen[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Jackie-SunModerator Monday, December 27, 2010 9:44 AM
    • Unmarked as answer by XHUNTYX Thursday, February 3, 2011 8:23 PM
    Friday, December 24, 2010 1:18 PM
  • Thank you for the reply!

    I am using the ODBC data provider (connection class and data adapter class to fill datasets) in VS 2010. Please note that I have just migrated to 2010 from 2008 and I'm still targeting the 3.5 version of the framework. I've spoken with 4D and they do not currently support ADO.NET. Please excuse my ignorance on this, but is there a different way to access data through the provided driver? My project is currently written in VB.



    Wednesday, January 5, 2011 4:36 PM
  • I am attempting to setup a 1 way synchronisation between a SQL 2005 database and a 4D v11 SQL database.

    I've found that the ODBC driver is extremely unreliable regardless of how you use it.

    Its impossible to setup a linked 4D server in SQL 2005 using the driver, even by setting up a DSN which connects successfully.

    The other issue is the errors that are reported by the ODBC driver are misleading or don't give sufficient information to aid troubleshooting.

    One thing I have found is that the 'Server rejected the connection. Failed to execute statement' errors can arise when you have an incorrectly named field in your SQL statement.

    To further complicate things, I am attempting to get a SQL trigger to update a remote 4D database over a VPN using CLR integration and that fails more often than it works. The error returned is 'Is the SQL se'!! It looks like a truncated version of the 'Is the SQL server running?' error you get when the 4D server app isn't running so I'm assuming its a general connectivity issue. Strangely, if I restart the SQL server service the error goes away for a short time.

    Thankfully our longer term plan is to ditch 4D entirely and I for one cannot wait until the day we can switch it off!!

    I wish you luck in getting yours working!!

    Friday, January 28, 2011 2:32 PM
  • Thank you for taking the time to relay your experience! While I’d hoped that there was some magical fix out there, I guess I’m just a little relieved to hear that I’m not the only one. I too wish the best! Thanks again!
    Thursday, February 3, 2011 8:12 PM
  • I am suffering the 4d ODBC to MSSQL connectivity issues. Can you please let me know how did you solve it? I am using 4dv12. Thanks!

    Tuesday, June 5, 2012 3:44 AM