From: Marc Verkade [Marti] on
Hello to all,

I have the feeling that ODBC returning Unicode strings does not work with
the standard SQL classes in VO.
I can connect to DBF (using foxpro ODBC or ADS) and Acces using the MS ODBC
driver.

I want to connect to uSoft using ODBC. It all connects, without error's, but
the fields are only giving empty strings.
Anybody a clue?

// Create and open the connection
oConnection:=SQLConnection{}
oConnection:Connect(sODBC,sUser,sPASS)

// See if we have an error IF
!IsNil(SELF:_Connection:ERRINFO)
// An error
SELF:_HasError:=TRUE
SELF:DebOutError()
Else
// It worked
SELF:_HasError:=FALSE
MC_DebOut32("Connection established for user
'"+Al(Proper(SELF:_User))+"'")

// Create a select statement
oSqlSelect:=SQLSelect{"Select * from bedrijf", oConnection}
oSqlSelect:Execute()

// Did it go well?
IF oSqlSelect:ERRINFO!=NIL
SELF:_HasError:=TRUE
SELF:DebOutError(oSqlSelect:ERRINFO)
Else
// Loop the records oSqlSelect:GoTop()
DO WHILE !oSqlSelect:Eof
// Show the values.. All empty!!!
MC_DebOut32(oSqlSelect:FIELDGET(#BD_CODE))

// Next
oSqlSelect:Skip(1)
END
End

Thanx and regards, Marc

From: Geoff Schaller on
Marc,

To work out whether it is a Unicode issue or not, can you import
numerics successfully? I assume you get the correct number of rows - but
you didn't say.

You are right that VO cannot handle Unicode but I would have thought the
ODBC layer would convert for you anyway, before it gets anywhere near
VO. So you could try a cast in the sql statement or check the width and
data type of what is returned. You have the source code to the sql
classes so you could break in to these methods to see if you can trap
the raw incoming data.

Geoff



"Marc Verkade [Marti]" <marcatm(a)rti.nl> wrote in message
news:4bfc1cb2$0$801$58c7af7e(a)news.kabelfoon.nl:

> Hello to all,
>
> I have the feeling that ODBC returning Unicode strings does not work with
> the standard SQL classes in VO.
> I can connect to DBF (using foxpro ODBC or ADS) and Acces using the MS ODBC
> driver.
>
> I want to connect to uSoft using ODBC. It all connects, without error's, but
> the fields are only giving empty strings.
> Anybody a clue?
>
> // Create and open the connection
> oConnection:=SQLConnection{}
> oConnection:Connect(sODBC,sUser,sPASS)
>
> // See if we have an error IF
> !IsNil(SELF:_Connection:ERRINFO)
> // An error
> SELF:_HasError:=TRUE
> SELF:DebOutError()
> Else
> // It worked
> SELF:_HasError:=FALSE
> MC_DebOut32("Connection established for user
> '"+Al(Proper(SELF:_User))+"'")
>
> // Create a select statement
> oSqlSelect:=SQLSelect{"Select * from bedrijf", oConnection}
> oSqlSelect:Execute()
>
> // Did it go well?
> IF oSqlSelect:ERRINFO!=NIL
> SELF:_HasError:=TRUE
> SELF:DebOutError(oSqlSelect:ERRINFO)
> Else
> // Loop the records oSqlSelect:GoTop()
> DO WHILE !oSqlSelect:Eof
> // Show the values.. All empty!!!
> MC_DebOut32(oSqlSelect:FIELDGET(#BD_CODE))
>
> // Next
> oSqlSelect:Skip(1)
> END
> End
>
> Thanx and regards, Marc

From: Arne Ortlinghaus on
Hi Marc,

this can be true that the standard SQL classes can not handle Unicode
characters since they are using only the ANSI ODBC functions. I think when
using ANSI ODBC there must be used column types that are not implemented in
the SQL classes.

I managed it with Oracle using functions that return a type of hex
representation (function dump) of the unicode string to read it as ANSI
characters and then convert it to strings with Unicode contents.

Arne Ortlinghaus
ACS Data Systems


From: Marc Verkade [Marti] on
Never mind,
I have transported the VO service and build the app in Vulcan.
That worked like a charm.

Thanx for you comments!

Regards, Marc

"Arne Ortlinghaus" <Arne.Ortlinghaus(a)acs.it> schreef in bericht
news:htnv8v$no4$1(a)news.eternal-september.org...
> Hi Marc,
>
> this can be true that the standard SQL classes can not handle Unicode
> characters since they are using only the ANSI ODBC functions. I think when
> using ANSI ODBC there must be used column types that are not implemented
> in the SQL classes.
>
> I managed it with Oracle using functions that return a type of hex
> representation (function dump) of the unicode string to read it as ANSI
> characters and then convert it to strings with Unicode contents.
>
> Arne Ortlinghaus
> ACS Data Systems
>
>