Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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.

  • Moderators
Posted

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

Visit...Bassic Software

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...