-
Oracle OLEDB Provider adds blanks
Hi,
as the this small prodedure demonstrates, the Oracle OLEDB Provider attaches some blanks to the constant read by the Sql-statement.
On the opposite the Microsoft Provider MSDAORA does what normally would be expected, it only prints out 1 single character.
What is the problem, is there something to configure ? The blankadding behaviour causes unnecessary problems.
The Oracle OLEDB Provider seems to have some problem with blanks, sometimes it adds some, sometimes it removes some.
Thanx.
Best regards
Dirk
Output Oracle provider ( with the crazy blanks following the F ) :
Used Provider OraOLEDB.Oracle.1
AttributeName : MARKER Value : -F -
AttributeName : TRIMMED_MARKER Value : -F-
Output using the Microsft Provider :
Used Provider : MSDAORA.1
AttributeName : MARKER Value : -F-
AttributeName : TRIMMED_MARKER Value : -F-
Demo Procedure :
Sub Show_Blank_Problem()
Dim rs As ADODB.Recordset
Dim strSQL As String
Dim i As Integer
Dim ConnectString As String
ConnectString = "Provider=MSDAORA; Data Source=MyOraDB;"
' ConnectString = "Provider=OraOLEDB.Oracle.1;Data Source=MyOraDB;"
Set OraConnect = New ADODB.Connection
OraConnect.Open ConnectString, "scott", "tiger"
strSQL = " select 'F' as Marker, Trim( 'F' ) as Trimmed_Marker from Dual "
Set rs = New ADODB.Recordset
rs.CursorLocation = adUseClient
rs.Open strSQL, OraConnect, adOpenStatic, adLockReadOnly
If rs.BOF And rs.EOF Then
Debug.Print "No Data Found!"
rs.Close
Exit Sub
End If
Debug.Print "Used Provider : " & OraConnect.Provider
Do While Not rs.EOF
For i = 0 To (rs.Fields.Count - 1)
Debug.Print "AttributeName : " & CStr(rs.Fields(i).Name) & " Value : " & "-" & rs.Fields(i) & "-"
Next i
rs.MoveNext
Loop
rs.Close
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|