开发者

I don't know what ADODB.Recordset is

I am converting a VB6 app to C#. I am starting on the top of the VB6 app and going from there. What is all the RS. stuff? I don't understand?

Sub Main()
    Dim RS As ADODB.Recordset
    Dim FileName As String, FilePath As String
    Dim Test As Boolean
    Dim ResultCode As xcdError

    Dim oAccess As Access.Application
    Dim Zip_File As String

    On Error GoTo ErrorHandler

    ' Make a connection to the database
    Call MakeDBConnection

    ' Create a recordset of the directories to check
    Set RS = New ADODB.Recordset

    RS.ActiveConnection = DB
    RS.CursorType = adOpenDynamic
    RS.LockType = adLockOptimistic
    RS.Open "Select ConversionDefinition.* From ConversionDefinition"
开发者_如何学Go    ' Check the directories for Raw Data
    ' If the required data is found, then start the coversion application
    If Not (RS.EOF And RS.BOF) Then
        RS.MoveFirst
        Do While Not (RS.EOF)


You should read this

The page explains it pretty well. It is an ADO DabaBase RecordSet.


It was the forerunner of ADO.NET. You can still use it in a C# program, it would make the conversion a lot less painful. Project + Add Reference, COM tab, select "Microsoft ActiveX Data Objects 2.8 Library". Earlier versions of Window might have 2.7. The statements should convert about one-to-one.

The .NET equivalent are the classes in the System.Data.OleDb namespace if you still work with Access databases. Using them will require a fairly heavy rewrite.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜