• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

VBA: How to transfer range table data in a ADODB recordset

inddon

Member
Hello There,

I would like to know how this can be achieved using VBA:

1. Clear the range table data.
2. To transfer the range table data to a ADODB recordset (excluding its 1st column). Please refer the code written for retrieve data in the workbook where ADODB recordset is used for retrieving the data and inserting it in the table.

Attached workbook for your reference.

Thanks & regards
Don
 

Attachments

  • Oracle OLEDB -Dept-Emp.xlsm
    39.1 KB · Views: 0
Below code to clear the range table data:

Code:
Private Sub cmdClearData_Click()
  Dim ws As Worksheet
   
  Set tbl = ActiveSheet.ListObjects("Table1")
   
  'Delete Table's Body Data
  If tbl.ListRows.Count >= 1 Then
  'Select Row 1, Column 1
  ActiveSheet.ListObjects("Table1").DataBodyRange(1, 1).Select
  tbl.DataBodyRange.Delete
  End If
   
   
End Sub

The code for retrieving data from Oracle and displaying it in the range table is in the workbook.

Please, now I would like to know how the updated data from the range table can be transferred to Oracle?

Appreciate your help .

Regards
Don
 
Back
Top