Below code is retrieving some columns data as ??? marks when Nonenglishcharacters exists
Dim oCon1: Set oCon1 = CreateObject("ADODB.Connection")
Dim oRs1: Set oRs1 = CreateObject("ADODB.Recordset")
Dim strCon1
'Oracle ODBC Driver 11.2.0.3.0
strCon1 = "Driver={Microsoft ODBC for Oracle};Server=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=XXXXXXXXXXXXXX)(PORT=XXX))(CONNECT_DATA=(SID=XXXXXX)));Uid=XXXX;Pwd=XXXX;"
oCon1.ConnectionString = strCon1
can you please help me with you solution to extract exact data
oCon1.Open
Query1 = Sheets("Query").Cells(1, 1).Value
Set oRs1 = oCon1.Execute(Query1)
STG_CAMT052.Activate
For colIndex = 0 To oRs1.Fields.Count - 1
STG_CAMT052.Cells(1, colIndex + 1) = oRs1.Fields(colIndex).Name
Next
'Cells(2, 1).CopyFromRecordset oRs1
oCon1.Close
oCon1.Open
Query1 = Sheets("Query").Cells(1, 1).Value
Set oRs1 = oCon1.Execute(Query1)
STG_CAMT052.Activate'(it activates the sheet)
Cells(2, 1).CopyFromRecordset oRs1
oCon1.Close
Bookmarks