Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Problem w SQLBindFile and OEM / ANSI under MSSQL

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default Problem w SQLBindFile and OEM / ANSI under MSSQL

    Hi,

    the MSSQL database uses ANSI and with "normal" VDF commands, the driver converts correctly between ANSI and OEM.
    Now i connect the table to SQL with SQLBindFile and i got a string wich is notOEM and not ANSI.
    See Screenshot for example. The character format in INT is ANSI.

    Click image for larger version. 

Name:	SQLBindFile.jpg 
Views:	250 
Size:	33.2 KB 
ID:	4386

  2. #2
    Join Date
    Feb 2009
    Location
    Hengelo, Netherlands
    Posts
    10,948

    Default Re: Problem w SQLBindFile and OEM / ANSI under MSSQL

    Thomas,

    ESQL does not use the INT file setting for OEM or ANSI. I therefore think the data in your buffer is ANSI and the debugger assumes it is OEM so does a OEM->ANSI conversion on an already ANSI string which causes the problems. Your 3rd expression proofs this.
    Regards,
    Data Access Worldwide
    Vincent Oorsprong

  3. #3

    Default Re: Problem w SQLBindFile and OEM / ANSI under MSSQL

    Vincent,

    Probably you are right. I also believe that the buffer has ANSI format. Therefore i wanted to change it to OEM with ToOEM(). But if you could see on the screenshot, it DOSNT work.

    Thomas

  4. #4
    Join Date
    Feb 2009
    Location
    Hengelo, Netherlands
    Posts
    10,948

    Default

    Thomas,

    Is it the underscore?

    Sent from my A500 using Tapatalk
    Regards,
    Data Access Worldwide
    Vincent Oorsprong

  5. #5

    Default Re: Problem w SQLBindFile and OEM / ANSI under MSSQL

    Vincent,

    yes, the underscore should be a "Ü". It should be the name of a german beer called "FRÜH KÖLSCH". If i meet you next time, we will drink it ...

    Thomas

  6. #6
    Join Date
    Feb 2009
    Location
    Hengelo, Netherlands
    Posts
    10,948

    Default Re: Problem w SQLBindFile and OEM / ANSI under MSSQL

    Thomas,

    I apparently did not look good enough at the picture, sorry.

    I find it very strange that the ToOEM on the result string does not produce the same information as when it is fully done in the CK.
    Regards,
    Data Access Worldwide
    Vincent Oorsprong

  7. #7

    Default Re: Problem w SQLBindFile and OEM / ANSI under MSSQL

    Vincent,

    thank you, for your empathy
    But what can i do now? Any workaround? Write a new MSSQL driver? Waiting or VDF 17?

    Is there any problem with my driver-configuration?

    Thomas

  8. #8
    Join Date
    Mar 2009
    Location
    USA or Sweden
    Posts
    1,424

    Default Re: Problem w SQLBindFile and OEM / ANSI under MSSQL

    May I suggest have a couple of "FRÜH KÖLSCH" and try this using Mertech's SQL driver. The new 11 drivers are really sharp.
    Gregg Finney



  9. #9
    Join Date
    Jan 2009
    Location
    Richmond, VA
    Posts
    5,858

    Default Re: Problem w SQLBindFile and OEM / ANSI under MSSQL

    Thomas,

    Does this happen even in a simple example or only in your application?

    When you use SQLBindFile are you passing 0 or an explicit file number?
    Best regards,

    -SWM-

  10. #10

    Default Re: Problem w SQLBindFile and OEM / ANSI under MSSQL

    Stephen,
    i use the EmbSQLSample.src and "Chapter3ODBC.vw" form the DAC exaples to reproduce the problem.
    Firts i convert the databas to the SQL2008 Server. Then i "manupulated" the source a little bit:


    //------------------------------------------------------------------------------------------------------
    //*** Connect to the database server
    Send SQLSetConnect of hoSQL "MSSQLDRV" "SERVER=braunerlt\SQL2008;Trusted_Connection=yes;D ATABASE=DAC_Test"
    Get SQLConnect Of hoSQL "" "" To hDbc
    If (hDbc <> 0) Begin
    //*** Open a statement
    Get SQLOpen Of hDbc To hStmt
    If (hStmt <> 0) Begin
    //*** Execute the statement, we do it only once so use direct
    //*** execution
    Send SQLExecDirect Of hStmt CS_QUERY

    //*** Traverse the result set
    Repeat
    Get SQLFetch Of hStmt To iFetchResult
    If (iFetchResult <> 0) Begin
    Get SQLColumnValue Of hStmt 1 To sName
    Get SQLColumnValue Of hStmt 2 To sAddress
    Get SQLColumnValue Of hStmt 3 To sCity
    Send AppendText Of oResults (sName+", "+sAddress+", "+sCity+sLineFeed)
    End

    Move (ToOEM(sName)) to sTest1OEM
    Move (ToANSI(sName)) to sTest1ANSI

    Send SQLBindFile of hStmt Customer.File_Number
    Move Customer.Name to sTestOrg
    Move (ToOEM(Customer.Name)) to sTestOEM
    Move (ToANSI(customer.Name)) to sTestANSI

    Until (iFetchResult = 0)
    Send SQLClose Of hStmt
    End
    //------------------------------------------------------------------------------------------------------

    Her are the results:






    Click image for larger version. 

Name:	DAC example.jpg 
Views:	147 
Size:	39.4 KB 
ID:	4391

    Thomas
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	DAC example.jpg 
Views:	135 
Size:	22.3 KB 
ID:	4390  

Page 1 of 2 12 LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •