Re: loading data from spread sheet to oracle database

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: ravinookala (ravinookala.11fys4_at_excelforum-nospam.com)
Date: 02/11/04


Date: Tue, 10 Feb 2004 21:01:18 -0600

Hi

Thank you very much for your help.

It is not necessary to select the field names in the record set.
If it is so, my programme will become hardcoded.
I have done it dynamic as under and working fine.

intFieldsCount = RS.Fields.Count
v_rowcount = Range("A1").CurrentRegion.Rows.Count - 1
With RS
For i = 0 To v_rowcount - 1
RS.AddNew
For j = 0 To intFieldsCount - 1
If IsEmpty(ActiveCell.Offset(0, j)) = True Then
.Fields(j).Value = Null
Else
.Fields(j).Value = Trim(ActiveCell.Offset(0, j))
End If
On Error Resume Next
Next j
RS.Update
ActiveCell.Offset(1, 0).Select
Next i
End With

Ravi Nookala

---
Message posted from http://www.ExcelForum.com/

Quantcast