This discussion is archived
0 Replies Latest reply: Apr 3, 2013 6:54 AM by 102986 RSS

OO4O 11.2.0.3 VB6 and RAW

102986 Newbie
Currently Being Moderated
Testing our new Oracle 11gR2 (11.2.0.3) box (Win32).
Client (XPSP3) with 11.2.0.3 client. We have some old VB6 app.
I've found a problem. Test case as follows:

Create Table RTEST (
pk Number(5),
rcol RAW(16)
) Tablespace...

Insert Into RTEST (pk,rcol) Values(1,HextoRaw('FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF'));
Commit;

Check with SQLDeveloper, 'RCOL' contains the correct value.

VB6:
Dim osess As OraSessionClass, odb As OraDatabase, ors As OraDynaset
Dim s1 As String, s2 As String, i As Long
...
Set osess = CreateObject("OracleInprocServer.XoraSession")
Set odb = osess.OpenDatabase("testdb", "testuser/testpassw", ORADB_ORAMODE)
Set ors = odb.CreateDynaset("Select * From RTEST Where pk=1", ORADYN_ORAMODE)
...

and now in Immediate Window:

s1 = ors("RCOL")

Print vbshex(s1)
"79797979797979797979797979797979" ?????

For i=1 To 16: s2 = s2 & Chr$(AscB(Mid$(ors("RCOL"),i,1))): Next

Print vbshex(s2)
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" It's OK.


With the new ODAC (11.2.0.3.20) the problem still exists.
On the old box (11gR1) all OK.
Note: vbshex(string) is an old user function, returns string content in hex notation.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points