Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2004
    Posts
    2

    Question Unanswered: Querying from Visual Basic

    Hello. First of all, I want to say that I am a beginner in Sybase. When that said:

    In Visual Basic, I query an Adaptive Server Anywhere database with something like this:

    Code:
    SELECT * FROM foo
    The query gives the following result (note the foreign characters, in this case swedish characters):


    id description
    --------------
    1 TestÅ123
    2 TestÖ123


    So far, that is the correct result. However, this query does not result in any rows at all:

    Code:
    SELECT * FROM foo WHERE description = 'TestÅ123'
    That is not correct. Selecting with a LIKE clause gives the correct result:

    Code:
    SELECT * FROM foo WHERE description LIKE '%Test%'
    When I try the second SELECT in a third-party-query-application it gives the correct resultset. So, the problem is, Visual Basic querys the database incorrectly when dealing with special characters.

    As said before, I am a beginner in Sybase. Any help would be appreciated.

    Thanks in advance.

  2. #2
    Join Date
    Sep 2002
    Location
    Hong Kong
    Posts
    159
    Check which character set your VB application is using. Ideally you should be using the same character set as the database server. If you're not something needs to do character set conversion; either your application or the connectivity library (Open Client / ODBC).

    Find out from your DBA what the is the default character set of the server. If you can, work with that character set. I think Windows uses ISO_1, but other platforms (HP UX for example) use "Roman 8" which is different.

  3. #3
    Join Date
    Jun 2004
    Posts
    2
    Ok. Thanks for your reply. But how can I check which character set my Visual Basic application is using?

  4. #4
    Join Date
    Sep 2002
    Location
    Hong Kong
    Posts
    159
    Sorry for the delay but I'm away from home and the office and the hotel has just got wi-fi. The character set that VB is using is probably "iso1", however the character set being used to talk to the database server may be specified when setting up the connection. I'm assuming this can be done within the DSN or connection properties.

Posting Permissions

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