Jump to content

OlmanQuesada

Mobilize.Net Staff
  • Content count

    31
  • Joined

  • Last visited

  • Days Won

    1

OlmanQuesada last won the day on March 23

OlmanQuesada had the most liked content!

Community Reputation

2 Neutral

About OlmanQuesada

  1. OlmanQuesada

    Documentation for UpgradeHelper projects

    You can find inline documentation in the helper classes and you're also free to edit them. The recordset helper tries to infer the right command type, but when the basic clauses are not fulfilled it has to get the database schema to find if the recordset is populated by querying to a table name. Retrieving the schema has a very important impact on the performance, so in this case modifying the source code by using the exec keyword would help to reduce the performance. Regards,
  2. OlmanQuesada

    Documentation for UpgradeHelper projects

    Hello Michael, In my understanding, the recordset is populated by executing a stored-procedure. Could you provide us a quick sample of how the recordset is populated? If you use the "exec" keyword when executing stored procedures the results is the expected?
  3. OlmanQuesada

    rs.getProperties().Item("Unique Table")

    Hello, ADO.Net does not provide that functionality as classic ADO or ADODB does, that’s why the VBUC generate a stub indicating that property is not supported. In order to achieve the same functionality will require changes in your migrated code. The VBUC converts classic ADO components (like the recordset) to ADO.Net components. In specific, the recordset is migrated to a helper class that inherits from the System.Data.Dataset object. This class includes methods/properties to emulate the behavior of the classic Recordset when possible, but there are some of them that cannot be emulated as ADO.Net does not provide any way to recreate them. For instance, using the <Recordset>.Properties(“Unique Table”) to indicate which table to be updated when the recordset is populated via a SQL JOIN statement. To get the functionality described above, you can use the <RecordsetHelper>, the Update/Insert/Select clauses must be provided in order to perform those operations. You can use the SQlInsertQuery, SQLUpdateQuery and SQLDeleteQuery properties of the RecordsetHelper class to indicate the Sql statement to use to execute SQL operations. As a workaround to this, Update/Insert/Delete SQL must be specified to perform those operations (here some info from Microsoft : https://docs.microsoft.com/en-us/aspnet/web-forms/overview/data-access/advanced-data-access-scenarios/updating-the-tableadapter-to-use-joins-cs)
  4. Oracle Data provider (ODP.Net) in a migrated project Old Visual Basic 6 applications interacting with Oracle databases may rely on the MSDAORA driver in the connection string to establish such communication when that code is converted to .NET, the Visual Basic Upgrade Companion (VBUC) will keep the same connection string and therefore be use the old MSDAORA driver. But, in .NET we can take advantage of the Oracle Data Provider (ODP.Net) technology developed by Oracle instead. The following VB6 code shows a database connection though the MSDAORA provider: Dim oConn As ADODB.Connection Set oConn = New ADODB.Connection oConn.ConnectionString = "Provider=MSDAORA.1;Password=" & sPassword & ";User ID = " & sUser & "; Data Source= " & sServer & ";Locales Identifier=1033" oConn.Open When this code is converted to .NET using the VBUC the code look like this: DbConnection oConn = UpgradeHelpers.DB.AdoFactoryManager.GetFactory().CreateConnection(); oConn.ConnectionString = "Provider=MSDAORA.1;Password=" + sPassword + ";User ID = " + sUser + "; Data Source= " + sServer + ";Locales Identifier=1033"; //UPGRADE_TODO: (7010) The connection string must be verified to fullfill the .NET data provider connection string requirements. More Information: https://www.mobilize.net/vbtonet/ewis/ewi7010 oConn.Open(); Note: ADODB component is migrated to ADO.NET using System.Data.Common and helper classes. As you can see the migrated application is still using the MSDAORA provider. If your final goal is taking full advantage of the .NET technology, you may want to replace that provider for the ODP.Net developed by Oracle. In this case, you need to go to the Oracle Data Provider .NET download page (http://www.oracle.com/technetwork/topics/dotnet/index-085163.html) and choose the required version of this .NET component. After installing and configuring the ODP.NET component on your machine you will have to make some minor adjustments to the migrated code: 1. Add the Oracle.DataAccess.Client factory Mobilize helper classes use a DVProviderFactory to create the right ADO.NET object according to the database connection provider in use: OleDb providers will use the System.Data.OleDb namespace. This is valid for MS-Access files and any OleDb provider like the MSDAORA one. ODBC providers will use the System.Data.ODBC namespace SqlServer can use the System.Data.SqlClient namespace Oracle providers for .NET will use Oracle.DataAccess.Client namespace that comes with the ODP.NET installer. If this assembly is not installed an exception will raise at runtime. To use the Oracle.DataAccess.Client, find the method Load DefaultFactorySettings that comes in the AdoFactoryManager class from the UpgradeHelpers.DB.Essentials helper project and uncomment-out the line: factorySection.Add("Oracle", new FactoryConfigurationElement("Oracle", "Oracle.DataAccess.Client", DatabaseType.Oracle, false)); and comment-out this line: factorySection.Add("Oracle", new FactoryConfigurationElement("Oracle", "Oracle.DataAccess.Client", DatabaseType.Oracle, false)); So, this method should looks like this: private static void LoadDefaultFactorySettings(Dictionary<string, FactoryConfigurationElement> factorySection) { factorySection.Add("Access", new FactoryConfigurationElement("Access", "System.Data.OleDb", DatabaseType.Access, true)); factorySection.Add("SQLServer", new FactoryConfigurationElement("SQLServer", "System.Data.SqlClient", DatabaseType.SQLServer, false)); //New Changes factorySection.Add("Oracle", new FactoryConfigurationElement("Oracle", "Oracle.DataAccess.Client", DatabaseType.Oracle, false)); //factorySection.Add("Oracle", new FactoryConfigurationElement("Oracle", "System.Data.OracleClient", DatabaseType.Oracle, false)); factorySection.Add("ODBC", new FactoryConfigurationElement("ODBC", "System.Data.Odbc", DatabaseType.Access, false)); } With these changes, any ADO.NET object (DBCommands, DBConnections, etc) created using the UpgradeHelpers.DB.AdoFactoryManager.GetFactory() will be instantiated using the types defined in Oracle.DataAccess.Client namespace. 2. Correct the Connection String As illustrated in the VB6 code above, the connection string is using an OLEDb provider (MSDAORA), so we need to change that string to send the parameters required by the ODP.NET provider: string conStr = "Data Source=(DESCRIPTION=(CID=GTU_APP)(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST="+ sServer + ")(PORT="+ sPort + ")))(CONNECT_DATA=(SID="+ sSID + ")(SERVER=shared)))"; conStr = conStr + ";" + "User Id=" + sUser + ";Password=" + sPassword; DbConnection oConn = UpgradeHelpers.DB.AdoFactoryManager.GetFactory().CreateConnection(); oConn.ConnectionString = conStr; oConn.Open(); Basically, these are the only changes in your code to establish an Oracle DataBase connection using ODP.NET. happy migration!
  5. OlmanQuesada

    MSDATASRC... doesn't work in code!

    Hi Devon, the cbo is a Activex Combobox, so it's not a .Net control. Because of that, the RowSource property cannot be assigned to a .Net class. At this point there are two alternatives: 1. Change the AxDataCombo by a .Net control. In that case it would be compatible with other .Net classes/components. This have to be done in a manual fashion as currently the VBUC does not automatically convert that control to a .Net one. 2. Migrate the vb6 code using ADODB via Com Interop (see attached file). By doing this, all classic adodb code willnot be converted to ADO.Net, so the cbo.RowSource and the rst object may be compatible. However, as you're converting your code to .Net my suggestion would be the option 1. Regards, OlmanQ
  6. OlmanQuesada

    No project converts

    Hi, Sorry for the misunderstanding. The VBUC requires all the references to all third party components as well as any library that is part of the VB6 project . The best way to validate that is compiling the vb6 code in the same machine where the VBUC tool is installed. You can get more information about how to prepare the code to be migrated by visiting our VBUC System Requirements page https://www.mobilize.net/support/documentation/VBUC-system-requirements Please, verify the vb6 code in your machine compiles and them try converting that code. OlmanQ
  7. OlmanQuesada

    Control array not upgraded

    Hi Good to hear that. OlmanQ
  8. OlmanQuesada

    Control array not upgraded

    Hi FGallagher, Is that possible to provide more info about the issue you are having? If would be helpful to get the following: 1. log file of the migration. You can get the log file by going to the Upgrade tab at the top of the VBUC and click on "Open Upgrade Log" button. 2. Screenshot of the error. Thanks, OlmanQ
  9. OlmanQuesada

    No project converts

    Hi, The vb6 application you're converting compiles in the machine where the VBUC is installed? OlmanQ
  10. OlmanQuesada

    VB6 to 2017 C# Migration

    Hi Ramya, Code migrated not necessarily compiles without requiring manual changes and having installed in the machine where the VS.Net code is located all thirdy party components required by the vb6application and are used via COM interop by the .Net migrated code. After migrating the vb6 code you may need to address the following issues in order to have the code compiling: 1. Make sure all dll's (COM and Assembly ones) and thirdy party components used by the vb6 application and used via COM Interop by the migrated code are installed on the development machine where Vs.Net code is located. If dll's required by the migrated code are not in the .Net development environment, then, missing references errors are thown by Vs.Net. 2. EWIs review: In the generated code you may find some messages inserted by the Upgrade tool that provide some useful information about code patterns/methods/events that have not a direct equivalent in .Net and require your attention: a.UPGRADE_TODO: (1065) Error handling statement (Resume Next | On Error Goto) could not be converted. b.UPGRADE_TODO: (1067) Member <member> is not defined in type <type> c.UPGRADE_ISSUE: (2064) <Object> (method | property | event) <member> was not upgraded d.UPGRADE_WARNING: (206) Untranslated statement in <method> e.UPGRADE_ERROR: (1010) The preceding line couldn't be parsed 3. If the converted application connects to a Database, some adjustments in the connection string may be needed. Please le tme know if this resolve your question. Regards, OlmanQ
  11. OlmanQuesada

    Migration issue from VB 6 to VB.NET 2017

    Hi Devashi, I looks like your vb6 application is using that component/reference that is used in the migrated application as well via COM Interop. Before migrating a vb6 application, make sure the source code to be migrated compiles, that would help you to know if there are missing components/references. Some of those components can be converted to .Net equivalents but some others don't so they would be used via COM Interop. All those components that would be used via COM Interop by the migrated code will need to be properly installed in the machine where the .Net code is executed. Please let me know if that answers your question. OlmanQ
  12. OlmanQuesada

    Upgrade hangs

    Hi Nas, The vb6 code is compiling on the machine where it's being migrated? I think I 'll need more info about the issue. Is it possible for you to send me the project being migrated. My email is oquesada@mobilize.net Regards, OlmanQ If so, it is possible for you to send me the project being migrated?
  13. OlmanQuesada

    Upgrade hangs

    Hi Nas, I'd like to ask you a couple of things: 1. Version of VBUC. You can get this info in the about windows. 2. Upgrade Log file. You can get it by going to the Upgrade section, then choose Open Upgrade Log. Regards, OlmanQ
  14. OlmanQuesada

    .dvb to vb.net

    Hi Shreenivas, The VBUC tool does not support dvb files as this is a proprietary AUTOCAD format so it's out of our control. Regards, OlmanQ
  15. OlmanQuesada

    .dvb to vb.net

    Hi, Could you please send me a vb6 sample including that file? I tried creating a vb6 project from scratch, then adding the attached dvb file, but VB6 is not able to add that file to a valid vb6 project.
×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Terms of Use