The VBUC is able to port the RDO data access code to ADO.NET by means of the System.Data.Common namespace. This technique is used in the following way:
The member transformation for this data access technology is described as follows:
Class | Maps to |
RDO.rdoConnection | System.Data.Common.DbConnection |
RDO.rdoResultset | Artinsoft.VB6.DB.RDO.RDORecordSetHelper |
RDO.rdoColumns | System.Data.DataColumnCollection |
RDO.rdoParameter | System.Data.Common.DbParameter |
RDO.rdoParameters | System.Data.Common.DbParameterCollection |
RDO.rdoPreparedStatement | System.Data.Common.DbCommand |
RDO.rdoQuery | System.Data.Common.DbCommand |
RDO.rdoEngine | Artinsoft.VB6.DB.RDO.RDOEngineHelper |
RDO.rdoEnvironment | Artinsoft.VB6.DB.RDO.RDOEnvironmentHelper |
RDO.rdoColumn | System.Data.DataColumn |
RDO.DataTypeConstants | System.Data.DbType |
RDO.LockTypeConstants | Artinsoft.VB6.DB.RDO.LockTypeConstants |
RDO.QueryTypeConstants | System.Data.CommandType |
Support for MSRDC data control is added into this feature using the Common namespace:
Class | Maps to |
MSRDC.MSRDC | Artinsoft.VB6.DB.RDO.RDODataControlHelper |
Public recRecordset As RDO.rdoResultset Public RDOConnection As New RDO.RDOConnection Private Sub Form_Load() Set RDOConnection = New RDO.RDOConnection RDOConnection.CursorDriver = rdUseClientBatch RDOConnection.Connect = "DSN=TestDB;UID=;PWD=;Database=TestDB" RDOConnection.EstablishConnection rdDriverNoPrompt, False Set recRecordset = RDOConnection.OpenResultset("select * from Countries", rdOpenKeyset, _ rdConcurBatch) recRecordset.MoveFirst End Sub
Public recRecordset As RDORecordSetHelper Private _RDOConnection As DbConnection = Nothing Private Sub Form1_Load(ByVal eventSender As Object, ByVal eventArgs As EventArgs) Handles MyBase.Load RDOConnection = Artinsoft.VB6.DB.AdoFactoryManager.GetFactory().CreateConnection() 'UPGRADE_ISSUE: (2064) RDO.CursorDriverConstants property CursorDriverConstants.rdUseClientBatch was not upgraded. More Information: http://www.vbtonet.com/ewis/ewi2064.aspx 'UPGRADE_ISSUE: (2064) RDO.RDOConnection property RDOConnection.CursorDriver was not upgraded. More Information: http://www.vbtonet.com/ewis/ewi2064.aspx UpgradeStubs.RDO_rdoConnection.setCursorDriver(RDOConnection, UpgradeStubs.RDO_CursorDriverConstants.getrdUseClientBatch()) RDOConnection.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\\TestDB.mdb" RDOConnection.Open() recRecordset = RDORecordSetHelper.Open("select * from Countries", RDOConnection, LockTypeConstants.rdConcurBatch, "") recRecordset.MoveFirst() End Sub
Note that the connection String (gray highlight) was manually added after the automated migration stage.
public RDORecordSetHelper recRecordset = null; private DbConnection _RDOConnection = null; private void Form1_Load( Object eventSender, EventArgs eventArgs) { RDOConnection = Artinsoft.VB6.DB.AdoFactoryManager.GetFactory().CreateConnection(); //UPGRADE_ISSUE: (2064) RDO.CursorDriverConstants property CursorDriverConstants.rdUseClientBatch was not upgraded. More Information: http://www.vbtonet.com/ewis/ewi2064.aspx //UPGRADE_ISSUE: (2064) RDO.RDOConnection property RDOConnection.CursorDriver was not upgraded. More Information: http://www.vbtonet.com/ewis/ewi2064.aspx UpgradeStubs.RDO_rdoConnection.setCursorDriver(RDOConnection, UpgradeStubs.RDO_CursorDriverConstants.getrdUseClientBatch()); RDOConnection.ConnectionString = "DSN=TestDB;UID=;PWD=;Database=TestDB"; RDOConnection.Open(); recRecordset = RDORecordSetHelper.Open("select * from Countries", RDOConnection, LockTypeConstants.rdConcurBatch, ""); recRecordset.MoveFirst(); DisplayInfo(); }
8834 N Capital of Texas Hwy, Ste 302
Austin, TX 78759
Call us: +1 (425) 609-8458
info@wearegap.com