Results 1 to 2 of 2

Thread: How to open local Access 2000 table into ADODB.RecordSet?

Threaded View

  1. #1

    Thread Starter
    Addicted Member kutlesh's Avatar
    Join Date
    Jun 2018
    Location
    Skopje, Macedonia
    Posts
    211

    How to open local Access 2000 table into ADODB.RecordSet?

    I am using this helper function to open my local helper table in ADODB.RecordSet with VB.NET.

    Code:
    Public Sub OpenRecordSetDynamic(ByRef recordSet As ADODB.Recordset, ByVal sql As String, ByRef dbConn As ADODB.Connection)
            Try
                recordSet.Open(sql, dbConn, ADODB.CursorTypeEnum.adOpenDynamic, ADODB.LockTypeEnum.adLockOptimistic, ADODB.CommandTypeEnum.adCmdText)
            Catch ex As Exception
                Dim funcName As String = System.Reflection.MethodInfo.GetCurrentMethod().Name
                Console.WriteLine(funcName & ": " & ex.Message & ", Source: " & ex.Source & ", StackTrace: " & ex.StackTrace)
            End Try
        End Sub
    where sql eguals:

    Code:
    DELETE FROM MyTable;
    I get an exception that the object is closed, i.e in this case, it doesn't open the table.

    Note: by local table i mean a table created in Access 2000.

    What should I do in VB.NET?
    And what do i do wrong?
    Last edited by kutlesh; Mar 5th, 2019 at 03:38 AM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width