Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

Go Back  dBforums > Database Server Software > Sybase > Querying from Visual Basic

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-16-04, 18:54
kristofferj kristofferj is offline
Registered User
 
Join Date: Jun 2004
Posts: 2
Question 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.
Reply With Quote
  #2 (permalink)  
Old 06-17-04, 15:28
richardcrossley richardcrossley is offline
Registered User
 
Join Date: Sep 2002
Location: Dublin, Ireland & Woking UK
Posts: 150
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.
Reply With Quote
  #3 (permalink)  
Old 06-18-04, 07:25
kristofferj kristofferj is offline
Registered User
 
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?
Reply With Quote
  #4 (permalink)  
Old 06-30-04, 18:17
richardcrossley richardcrossley is offline
Registered User
 
Join Date: Sep 2002
Location: Dublin, Ireland & Woking UK
Posts: 150
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.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On