sqlstr = concatenate() 'concatenating the SQL pasted in multiple lines
objrs.Open sqlstr, objconn
xlWs.Cells(2, 1).CopyFromRecordset objrs
As an alternate we can check for nulls in each row and column but it becomes very slow (as follows)
'Var = 2
'While Not objrs.EOF
' For iCol = 1 To colcount
' Val1 = objrs(objrs.Fields(iCol - 1).Name).Value
' If IsNull(Val1) Then
' Val1 = "NULL"
' End If
' xlWs.Cells(Var, iCol).Value = Val1
' Var = Var + 1
Can someone help me in making this thing a fast working.
I posted this in connectivity section as I wanted to know is there any way we can activate the "facility to replace NULL values with any string we want", from VBA by doing something on the connection. Any argument or anything?