skip to Main Content

I migrated asp.net application (copy-paste) because no access over source code.
I installed the same versions of odbc Mysql connector, Mysql server etc…

After the move and changing the connectionstring, I get everything started. I log in the application (which already asks for connection to DB because it shows the users already) but then I get this error:

COMException

I searched already thru the whole server to see differences, and it’s also old code…

Anyone an idea. The only difference I still see is windows server 2016 and 2022 but I don’t think this causes this behavior?

Thanks!
your text

  • Checked same versions of connector, mysql etc
  • config of all those application (where possible) check

2

Answers


  1. Chosen as BEST ANSWER

    Thank you a lot for the response. I've been checking all the things you mentioned and it seems to be all ok. What actually didn't surprise me, because it actually connect with the DB, because on the login page you can see the users defined in the DB. But when I login (only typing the password) it gives this error...

    I installed all the same versions of Mysql,etc (what wasn't easy to find because of the old versions..). It seems the application connects, but for some reason the connection with the DB fails again. When i see processes in Mysql, it sleeps immediately.

    I tried by removing the connection in Mysql, the application opens actually, but no queries can be made....

    Is there a setting in Mysql which could cause this?


  2. Only to a VERY limited change in markup can you attempt to modify the markup WITHOUT having changed markup AND the code behind page together.

    In some cases, some of the markup can be changed, but not much, and any changes say to an existing control often cannot be done without a re-compile of the page class (the code behind) for that given page.

    This "strong" suggests you need to work from, and have a working copy of the project, and the source code behind that is paired to each page.

    However, if the code behind used the settings class, then often some of the connection information becomes part of a compiled class, and thus a re-build of the source code would be required for such changes to take effect.

    Now, if you copied the whole site, and only the site?
    (No other modifications).

    Then this is workable, and the site should run. However, as noted, some of the application settings if used actually wind up modifying the web.config, but ALSO wind up generating a static compiled class.

    This screen shows this example:

    enter image description here

    So, when I make changes to above? Yes, the settings are saved/changed in web.config, but there is also this class generated by code behind:

    So, if I open Settings.Desinger.cs?

    Then I now see/get this (this is a small code snip of that class).

        public static Settings Default {
            get {
                return defaultInstance;
            }
        }
        
        [global::System.Configuration.ApplicationScopedSettingAttribute()]
        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [global::System.Configuration.SpecialSettingAttribute(global::System.Configuration.SpecialSetting.ConnectionString)]
        [global::System.Configuration.DefaultSettingValueAttribute("Data Source=ALBERTKALLAL\SQLEXPRESS;Initial Catalog=Test4;Integrated Security=Tru" +
            "e")]
        public string TEST4 {
            get {
                return ((string)(this["TEST4"]));
            }
        }
    

    So, what the above means?

    If I used that class in my code, in place of the configuration manager, then JUST a change in web.config will not suffice.

    However, I would also check a few more things.

    First, you might want to force the project to run as x32 bits.

    And that project looks to be using ADODB, which is unmanaged code, and is not the built-in .net oleDB provider. (this is somewhat unusual).

    So, you need to install the ADO library and drivers. (I hope this is not the case, but "openreordset" is not a .net library, but looks to be ADODB was used in place of ADO.NET.

    So, I would ensure that ADODB is installed on that computer.

    Also, was the original site running MySQL, or SQL server?

    So, make sure you install the x32 bit driver(s) for MySQL, and install the oleDB drivers for ADODB for MySQL. (That error message suggests that ADODB is being used here, and not ADO.NET).

    I would as note, make sure the app-pools for x32 bits are running on IIS.

    So, as long as you are not changing the markup in the pages, but only having copied the full working folder (including the bin folder) to the new computer, then the site should be able to run. However, you want to check if x32 bit app-pools are running.

    So, not only do you want to install the ado.net provider for MySQL, but you also need to install the ADODB one. That is (unfortunately) an un-managed code library, and suggests that the bit-size of the project when compiled and build will matter.

    So, try and ensure you running x32 bits for the web site.

    Install not only the .net provider(s) for MySQL, but also the ADODB ones (and they come in x32 and x64 bit flavors).

    However, if the Settings.Designer.cs was used in code behind. (or perhaps vb.net), then you require a re-compile and re-build of the site, since that "static" class will have during the build and compile process pulled "connection" values into that compiled code. This means a change of just web.config connections will in fact not work.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search