Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

C# Very wierd odbc connection issue

Options
  • 28-09-2012 11:57am
    #1
    Registered Users Posts: 7,501 ✭✭✭


    I built a very simple application which connects to a database via a configured odbc datasource and returns the result of a query.

    It is a single EXE with no configuration files.

    The application works perfectly but for some reason i found that if i place it in one directory it fails to connect to the database but another directory it works fine. :confused::confused:

    Example :

    C:\MyTools\Utility\MyApp.exe (fails)
    C:\MyTools\Utility2\MyApp.exe (succeeds)

    I dont know whats going on. There are no configured paths in the code.

    Any idea what could be unique to this folder which would cause it to fail.


Comments

  • Registered Users Posts: 2,022 ✭✭✭Colonel Panic


    Hard to tell without knowing what you're doing. What have you tried? What happens when you debug the program from those example locations?


  • Registered Users Posts: 859 ✭✭✭goldenhoarde


    try renaming the exe that is not working as a test. Vaguely remember having to do this before for something similar. If my brain gets up to speed and remembers anything else i'll repost


  • Registered Users Posts: 2,781 ✭✭✭amen


    Why exactly does it fail ? Are you catching exceptions ?


  • Registered Users Posts: 7,501 ✭✭✭BrokenArrows


    I figured it out.

    The original program which my program was designed to replace was configured to run in compatibility mode for some reason.

    My program had the same file name as the original and it looks like when you replace a file with the same file name it keeps the compatibility mode settings.

    Turning off the compatibility mode and it all works.


Advertisement