Roey Posted April 29, 2003 Posted April 29, 2003 I have a 3 tier application that I amd trying to convert from VB6 to .Net Listed below is the code to acces some of the data using ADO ___________________________________________________ Option Explicit Private cnMRP As ADODB.Connection Private strSQL As String Private rsGeneric As New ADODB.Recordset Private rsCountry As New ADODB.Recordset ___________________________________________________ Private Sub Class_Initialize() Set cnMRP = New ADODB.Connection cnMRP.ConnectionString "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Elantis\MRP.mdb;Persist Security Info=False" End Sub ___________________________________________________ Private Sub Class_Terminate() Set cnMRP = Nothing End Sub ___________________________________________________ Public Function Get_Country(CountryCode As String) As ADODB.Recordset cnMRP.Open cnMRP.CursorLocation = AdUseClient . strSQL = "SELECT tblCountryMaster.CountryCode, tblCountryMaster.Description " & _ "FROM tblCountryMaster " & _ "WHERE CountryCode = '" & CountryCode & "'" Set Get_Country = cnMRP.Execute(strSQL) Get_Country.ActiveConnection = Nothing cnMRP.Close End Function ___________________________________________________ I have some information on making the connection using ADO.Net, but am not sure how to break down the individual function calls. Any help on this would be greatly appreciated. Quote
Moderators Robby Posted April 29, 2003 Moderators Posted April 29, 2003 As you may have noticed, recordsets no longer exist in ADO.NET. There are many methods of accessing then displaying data using ADO.NET, this should get you started ....http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconaccessingadofromadonet.asp Quote Visit...Bassic Software
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.