我不知道 ADODB.Recordset 是什么
我正在将 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您应该阅读 此
该页面对此进行了很好的解释。它是一个 ADO DabaBase 记录集。
You should read this
The page explains it pretty well. It is an ADO DabaBase RecordSet.
它是 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.