我不知道 ADODB.Recordset 是什么

发布于 2024-10-01 10:05:30 字数 860 浏览 4 评论 0原文

我正在将 VB6 应用程序转换为 C#。我从 VB6 应用程序的顶部开始,然后从那里开始。 RS 是什么?东西?我不明白?

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"
    ' 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)

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"
    ' 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)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

抠脚大汉 2024-10-08 10:05:30

您应该阅读

该页面对此进行了很好的解释。它是一个 ADO DabaBase 记录集。

You should read this

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

与君绝 2024-10-08 10:05:30

它是 ADO.NET 的前身。您仍然可以在 C# 程序中使用它,这会让转换变得不那么痛苦。项目 + 添加引用,COM 选项卡,选择“Microsoft ActiveX Data Objects 2.8 Library”。早期版本的 Window 可能有 2.7。这些语句应该大约一对一地转换。

如果您仍然使用 Access 数据库,则 .NET 等效项是 System.Data.OleDb 命名空间中的类。使用它们将需要相当大量的重写。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文