Showing posts with label software. Show all posts
Showing posts with label software. Show all posts

Friday, March 9, 2012

Non English Characters

Hi,
We are developing a small web interface to a local ERP software, which
uses SQL Server 2000 as database. The database uses SQL_Latin1_CP1
collation, and the fields are varchar (not nvarchar), however, the main
program inserts and reads non-English (Turkish) characters into these
columns. However, when we connect to database with ADO.NET, these
characters are not read correctly. (The situation is same when I check
tables with Enterprise Manager and Query Analyzer)

In a past situation (which was about a Win32 application), I have heard
about character conversion behaviour of ADO (and many other DB
libraries) and solved that problem using BDE instead of ADO, so that
the connection is made via DB-Library instead of OLEDB.

But this way cannot be applied to my ASP.NET situation, and there is NO
way to change database collation. Must I use a ADO.NET property, or use
another provider, or maybe another library? Any advices? Thanks...Set your culture settings in your web.config file for the appropriate code
set that you use. This should solve the problem. You can also cast the
characters to ASCII by doing this (courtesy or Erland Sommerskog)

SELECT convert(varchar(6), N'IGDEM' COLLATE Cyrillic_General_CS_AS)

--
Hilary Cotter
Director of Text Mining and Database Strategy
RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.

This posting is my own and doesn't necessarily represent RelevantNoise's
positions, strategies or opinions.

Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
<saygin@.gmail.comwrote in message
news:1159361639.289293.15470@.d34g2000cwd.googlegro ups.com...

Quote:

Originally Posted by

Hi,
We are developing a small web interface to a local ERP software, which
uses SQL Server 2000 as database. The database uses SQL_Latin1_CP1
collation, and the fields are varchar (not nvarchar), however, the main
program inserts and reads non-English (Turkish) characters into these
columns. However, when we connect to database with ADO.NET, these
characters are not read correctly. (The situation is same when I check
tables with Enterprise Manager and Query Analyzer)
>
In a past situation (which was about a Win32 application), I have heard
about character conversion behaviour of ADO (and many other DB
libraries) and solved that problem using BDE instead of ADO, so that
the connection is made via DB-Library instead of OLEDB.
>
But this way cannot be applied to my ASP.NET situation, and there is NO
way to change database collation. Must I use a ADO.NET property, or use
another provider, or maybe another library? Any advices? Thanks...
>

|||A couple more thoughts are you storing the strings in nVarchar(20) data type
columns. Also if you use Erland's method you will loose the Turkish
characters if you store them using his technique but the searching should
work.

--
Hilary Cotter
Director of Text Mining and Database Strategy
RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.

This posting is my own and doesn't necessarily represent RelevantNoise's
positions, strategies or opinions.

Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
<saygin@.gmail.comwrote in message
news:1159361639.289293.15470@.d34g2000cwd.googlegro ups.com...

Quote:

Originally Posted by

Hi,
We are developing a small web interface to a local ERP software, which
uses SQL Server 2000 as database. The database uses SQL_Latin1_CP1
collation, and the fields are varchar (not nvarchar), however, the main
program inserts and reads non-English (Turkish) characters into these
columns. However, when we connect to database with ADO.NET, these
characters are not read correctly. (The situation is same when I check
tables with Enterprise Manager and Query Analyzer)
>
In a past situation (which was about a Win32 application), I have heard
about character conversion behaviour of ADO (and many other DB
libraries) and solved that problem using BDE instead of ADO, so that
the connection is made via DB-Library instead of OLEDB.
>
But this way cannot be applied to my ASP.NET situation, and there is NO
way to change database collation. Must I use a ADO.NET property, or use
another provider, or maybe another library? Any advices? Thanks...
>

|||Hi, thanks for your interest.
Changing culture setting did not help, also there is no chance to
change data type of columns, they are varchar, not nvarchar.
Character conversion of database libraries and using a DB-Library based
API (in my previous example I'd chosen BDE) was Mr.Erland's
recommendation also :) However I cannot find a similar solution for
ASP.NET

Hilary Cotter wrote:

Quote:

Originally Posted by

A couple more thoughts are you storing the strings in nVarchar(20) data type
columns. Also if you use Erland's method you will loose the Turkish
characters if you store them using his technique but the searching should
work.
>
--
Hilary Cotter
Director of Text Mining and Database Strategy
RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.
>
This posting is my own and doesn't necessarily represent RelevantNoise's
positions, strategies or opinions.
>
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
>
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
>
>
>
<saygin@.gmail.comwrote in message
news:1159361639.289293.15470@.d34g2000cwd.googlegro ups.com...

Quote:

Originally Posted by

Hi,
We are developing a small web interface to a local ERP software, which
uses SQL Server 2000 as database. The database uses SQL_Latin1_CP1
collation, and the fields are varchar (not nvarchar), however, the main
program inserts and reads non-English (Turkish) characters into these
columns. However, when we connect to database with ADO.NET, these
characters are not read correctly. (The situation is same when I check
tables with Enterprise Manager and Query Analyzer)

In a past situation (which was about a Win32 application), I have heard
about character conversion behaviour of ADO (and many other DB
libraries) and solved that problem using BDE instead of ADO, so that
the connection is made via DB-Library instead of OLEDB.

But this way cannot be applied to my ASP.NET situation, and there is NO
way to change database collation. Must I use a ADO.NET property, or use
another provider, or maybe another library? Any advices? Thanks...

|||Hi,
Choosing ODBC provider rather than OLEDB, and turning of character
translation option solved my problem.

saygin@.gmail.com wrote:

Quote:

Originally Posted by

Hi, thanks for your interest.
Changing culture setting did not help, also there is no chance to
change data type of columns, they are varchar, not nvarchar.
Character conversion of database libraries and using a DB-Library based
API (in my previous example I'd chosen BDE) was Mr.Erland's
recommendation also :) However I cannot find a similar solution for
ASP.NET
>
>
>
>
Hilary Cotter wrote:

Quote:

Originally Posted by

A couple more thoughts are you storing the strings in nVarchar(20) data type
columns. Also if you use Erland's method you will loose the Turkish
characters if you store them using his technique but the searching should
work.

--
Hilary Cotter
Director of Text Mining and Database Strategy
RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.

This posting is my own and doesn't necessarily represent RelevantNoise's
positions, strategies or opinions.

Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
<saygin@.gmail.comwrote in message
news:1159361639.289293.15470@.d34g2000cwd.googlegro ups.com...

Quote:

Originally Posted by

Hi,
We are developing a small web interface to a local ERP software, which
uses SQL Server 2000 as database. The database uses SQL_Latin1_CP1
collation, and the fields are varchar (not nvarchar), however, the main
program inserts and reads non-English (Turkish) characters into these
columns. However, when we connect to database with ADO.NET, these
characters are not read correctly. (The situation is same when I check
tables with Enterprise Manager and Query Analyzer)
>
In a past situation (which was about a Win32 application), I have heard
about character conversion behaviour of ADO (and many other DB
libraries) and solved that problem using BDE instead of ADO, so that
the connection is made via DB-Library instead of OLEDB.
>
But this way cannot be applied to my ASP.NET situation, and there is NO
way to change database collation. Must I use a ADO.NET property, or use
another provider, or maybe another library? Any advices? Thanks...
>

Non English Characters

Hi,
We are developing a small web interface to a local ERP software, which
uses SQL Server 2000 as database. The database uses SQL_Latin1_CP1
collation, and the fields are varchar (not nvarchar), however, the main
program inserts and reads non-English (Turkish) characters into these
columns. However, when we connect to database with ADO.NET, these
characters are not read correctly. (The situation is same when I check
tables with Enterprise Manager and Query Analyzer)
In a past situation (which was about a Win32 application), I have heard
about character conversion behaviour of ADO (and many other DB
libraries) and solved that problem using BDE instead of ADO, so that
the connection is made via DB-Library instead of OLEDB.
But this way cannot be applied to my ASP.NET situation, and there is NO
way to change database collation. Must I use a ADO.NET property, or use
another provider, or maybe another library? Any advices? Thanks...
Set your culture settings in your web.config file for the appropriate code
set that you use. This should solve the problem. You can also cast the
characters to ASCII by doing this (courtesy or Erland Sommerskog)
SELECT convert(varchar(6), N'IGDEM' COLLATE Cyrillic_General_CS_AS)
Hilary Cotter
Director of Text Mining and Database Strategy
RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.
This posting is my own and doesn't necessarily represent RelevantNoise's
positions, strategies or opinions.
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
<saygin@.gmail.com> wrote in message
news:1159361639.289293.15470@.d34g2000cwd.googlegro ups.com...
> Hi,
> We are developing a small web interface to a local ERP software, which
> uses SQL Server 2000 as database. The database uses SQL_Latin1_CP1
> collation, and the fields are varchar (not nvarchar), however, the main
> program inserts and reads non-English (Turkish) characters into these
> columns. However, when we connect to database with ADO.NET, these
> characters are not read correctly. (The situation is same when I check
> tables with Enterprise Manager and Query Analyzer)
> In a past situation (which was about a Win32 application), I have heard
> about character conversion behaviour of ADO (and many other DB
> libraries) and solved that problem using BDE instead of ADO, so that
> the connection is made via DB-Library instead of OLEDB.
> But this way cannot be applied to my ASP.NET situation, and there is NO
> way to change database collation. Must I use a ADO.NET property, or use
> another provider, or maybe another library? Any advices? Thanks...
>
|||A couple more thoughts are you storing the strings in nVarchar(20) data type
columns. Also if you use Erland's method you will loose the Turkish
characters if you store them using his technique but the searching should
work.
Hilary Cotter
Director of Text Mining and Database Strategy
RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.
This posting is my own and doesn't necessarily represent RelevantNoise's
positions, strategies or opinions.
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
<saygin@.gmail.com> wrote in message
news:1159361639.289293.15470@.d34g2000cwd.googlegro ups.com...
> Hi,
> We are developing a small web interface to a local ERP software, which
> uses SQL Server 2000 as database. The database uses SQL_Latin1_CP1
> collation, and the fields are varchar (not nvarchar), however, the main
> program inserts and reads non-English (Turkish) characters into these
> columns. However, when we connect to database with ADO.NET, these
> characters are not read correctly. (The situation is same when I check
> tables with Enterprise Manager and Query Analyzer)
> In a past situation (which was about a Win32 application), I have heard
> about character conversion behaviour of ADO (and many other DB
> libraries) and solved that problem using BDE instead of ADO, so that
> the connection is made via DB-Library instead of OLEDB.
> But this way cannot be applied to my ASP.NET situation, and there is NO
> way to change database collation. Must I use a ADO.NET property, or use
> another provider, or maybe another library? Any advices? Thanks...
>
|||Hi, thanks for your interest.
Changing culture setting did not help, also there is no chance to
change data type of columns, they are varchar, not nvarchar.
Character conversion of database libraries and using a DB-Library based
API (in my previous example I'd chosen BDE) was Mr.Erland's
recommendation also However I cannot find a similar solution for
ASP.NET
Hilary Cotter wrote:[vbcol=seagreen]
> A couple more thoughts are you storing the strings in nVarchar(20) data type
> columns. Also if you use Erland's method you will loose the Turkish
> characters if you store them using his technique but the searching should
> work.
> --
> Hilary Cotter
> Director of Text Mining and Database Strategy
> RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.
> This posting is my own and doesn't necessarily represent RelevantNoise's
> positions, strategies or opinions.
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602.html
> Looking for a FAQ on Indexing Services/SQL FTS
> http://www.indexserverfaq.com
>
> <saygin@.gmail.com> wrote in message
> news:1159361639.289293.15470@.d34g2000cwd.googlegro ups.com...
|||Hi,
Choosing ODBC provider rather than OLEDB, and turning of character
translation option solved my problem.
saygin@.gmail.com wrote:[vbcol=seagreen]
> Hi, thanks for your interest.
> Changing culture setting did not help, also there is no chance to
> change data type of columns, they are varchar, not nvarchar.
> Character conversion of database libraries and using a DB-Library based
> API (in my previous example I'd chosen BDE) was Mr.Erland's
> recommendation also However I cannot find a similar solution for
> ASP.NET
>
>
> Hilary Cotter wrote:

Non English Characters

Hi,
We are developing a small web interface to a local ERP software, which
uses SQL Server 2000 as database. The database uses SQL_Latin1_CP1
collation, and the fields are varchar (not nvarchar), however, the main
program inserts and reads non-English (Turkish) characters into these
columns. However, when we connect to database with ADO.NET, these
characters are not read correctly. (The situation is same when I check
tables with Enterprise Manager and Query Analyzer)
In a past situation (which was about a Win32 application), I have heard
about character conversion behaviour of ADO (and many other DB
libraries) and solved that problem using BDE instead of ADO, so that
the connection is made via DB-Library instead of OLEDB.
But this way cannot be applied to my ASP.NET situation, and there is NO
way to change database collation. Must I use a ADO.NET property, or use
another provider, or maybe another library? Any advices? Thanks...Set your culture settings in your web.config file for the appropriate code
set that you use. This should solve the problem. You can also cast the
characters to ASCII by doing this (courtesy or Erland Sommerskog)
SELECT convert(varchar(6), N'IGDEM' COLLATE Cyrillic_General_CS_AS)
Hilary Cotter
Director of Text Mining and Database Strategy
RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.
This posting is my own and doesn't necessarily represent RelevantNoise's
positions, strategies or opinions.
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
<saygin@.gmail.com> wrote in message
news:1159361639.289293.15470@.d34g2000cwd.googlegroups.com...
> Hi,
> We are developing a small web interface to a local ERP software, which
> uses SQL Server 2000 as database. The database uses SQL_Latin1_CP1
> collation, and the fields are varchar (not nvarchar), however, the main
> program inserts and reads non-English (Turkish) characters into these
> columns. However, when we connect to database with ADO.NET, these
> characters are not read correctly. (The situation is same when I check
> tables with Enterprise Manager and Query Analyzer)
> In a past situation (which was about a Win32 application), I have heard
> about character conversion behaviour of ADO (and many other DB
> libraries) and solved that problem using BDE instead of ADO, so that
> the connection is made via DB-Library instead of OLEDB.
> But this way cannot be applied to my ASP.NET situation, and there is NO
> way to change database collation. Must I use a ADO.NET property, or use
> another provider, or maybe another library? Any advices? Thanks...
>|||A couple more thoughts are you storing the strings in nVarchar(20) data type
columns. Also if you use Erland's method you will loose the Turkish
characters if you store them using his technique but the searching should
work.
Hilary Cotter
Director of Text Mining and Database Strategy
RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.
This posting is my own and doesn't necessarily represent RelevantNoise's
positions, strategies or opinions.
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
<saygin@.gmail.com> wrote in message
news:1159361639.289293.15470@.d34g2000cwd.googlegroups.com...
> Hi,
> We are developing a small web interface to a local ERP software, which
> uses SQL Server 2000 as database. The database uses SQL_Latin1_CP1
> collation, and the fields are varchar (not nvarchar), however, the main
> program inserts and reads non-English (Turkish) characters into these
> columns. However, when we connect to database with ADO.NET, these
> characters are not read correctly. (The situation is same when I check
> tables with Enterprise Manager and Query Analyzer)
> In a past situation (which was about a Win32 application), I have heard
> about character conversion behaviour of ADO (and many other DB
> libraries) and solved that problem using BDE instead of ADO, so that
> the connection is made via DB-Library instead of OLEDB.
> But this way cannot be applied to my ASP.NET situation, and there is NO
> way to change database collation. Must I use a ADO.NET property, or use
> another provider, or maybe another library? Any advices? Thanks...
>|||Hi, thanks for your interest.
Changing culture setting did not help, also there is no chance to
change data type of columns, they are varchar, not nvarchar.
Character conversion of database libraries and using a DB-Library based
API (in my previous example I'd chosen BDE) was Mr.Erland's
recommendation also However I cannot find a similar solution for
ASP.NET
Hilary Cotter wrote:[vbcol=seagreen]
> A couple more thoughts are you storing the strings in nVarchar(20) data ty
pe
> columns. Also if you use Erland's method you will loose the Turkish
> characters if you store them using his technique but the searching should
> work.
> --
> Hilary Cotter
> Director of Text Mining and Database Strategy
> RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.
> This posting is my own and doesn't necessarily represent RelevantNoise's
> positions, strategies or opinions.
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602.html
> Looking for a FAQ on Indexing Services/SQL FTS
> http://www.indexserverfaq.com
>
> <saygin@.gmail.com> wrote in message
> news:1159361639.289293.15470@.d34g2000cwd.googlegroups.com...|||Hi,
Choosing ODBC provider rather than OLEDB, and turning of character
translation option solved my problem.
saygin@.gmail.com wrote:[vbcol=seagreen]
> Hi, thanks for your interest.
> Changing culture setting did not help, also there is no chance to
> change data type of columns, they are varchar, not nvarchar.
> Character conversion of database libraries and using a DB-Library based
> API (in my previous example I'd chosen BDE) was Mr.Erland's
> recommendation also However I cannot find a similar solution for
> ASP.NET
>
>
> Hilary Cotter wrote:

Monday, February 20, 2012

No Suitable Driver

Hi

I installed the free software MS SQL Server 2000 from microsoft.com.
I installed the JDBC driver from the following microsoft link
http://msdn.microsoft.com/downloads/default.asp?URL=/downloads/sample.asp?url=/MSDN-FILES/027/001/779/msdncompositedoc.xml

I set the classpath to point to the jar files in the lib folder in the driver I downloaded.

I wrote the following test file to test the connectivity import java.io.*;
import java.sql.*;

public class Test
{

public static final String DB_URL = "jdbc:JDataConnect://localhost/testdb";
public static final String DB_USERNAME = "";
public static final String DB_PASSWORD = "";
public static final String DB_DRIVER = "com.microsoft.jdbc.base.BaseDriver";

public static void main(String args[])
{

ResultSet rs = null;
try
{
Class.forName (DB_DRIVER);
Connection conn=DriverManager.getConnection(DB_URL, DB_USERNAME, DB_PASSWORD);

System.out.println("Connection established");
}
catch(Exception e)
{
System.out.println("An exception has occurred" +e);
}
}
}

when I run this code using java Test after successful compilation I get the following error

An exception has occurredjava.sql.SQLException: No suitable driver

Please Help !!!!

Thanks in Advance

PlumTry this

it working for me

import java.io.*;
import java.sql.*;

public class Test
{

public static final String DB_URL = "jdbc:microsoft:sqlserver://server1:port1";
public static final String DB_USERNAME = "sa";
public static final String DB_PASSWORD = "a108810";
public static final String DB_DRIVER = "com.microsoft.jdbc.sqlserver.SQLServerDriver";

public static void main(String args[])
{

ResultSet rs = null;
try
{
Class.forName (DB_DRIVER);
Connection conn=DriverManager.getConnection(DB_URL, DB_USERNAME, DB_PASSWORD);

System.out.println("Connection established");
}
catch(Exception e)
{
System.out.println("An exception has occurred" +e);
}
}
}|||When I tried to run your Test code.

An exception has occurredjava.lang.ClassNotFoundException: com.microsoft.jdbc.sqlserver.SQLServerDriver

I setup CLASSPATH to the 3 jar files which downloaded from microsoft.com, and I do not know WHY??

James|||the same siatuation happened to me
sometimes drivers cannot be found in jar files
try unpack the jar files in your work directory

Originally posted by james_hu
When I tried to run your Test code.

An exception has occurredjava.lang.ClassNotFoundException: com.microsoft.jdbc.sqlserver.SQLServerDriver

I setup CLASSPATH to the 3 jar files which downloaded from microsoft.com, and I do not know WHY??

James|||Hi,

My problem solved, I put space between ";" for CLASSPATH.
classpath=.; c:\..\msbase.jar; c:\..

MUST be classpath=.;c:\..\msbase.jar;c:\..
NO SPACE for classpath!!!

This is stupid JAVA, it should be improve later, this problem wastes my huge time!!!

I am not sure this is your prolem.

James