473,322 Members | 1,501 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

isql / osql / Windows XP / disable "Automatic ANSI to OEM conversion"

Hello to all SQL Server junkies who work with non-English characters:

For people running scripts from the command line using ANSI files with
special characters, it is very important to use isql and disable
"Automatic ANSI to OEM conversion":
- This only affects isql from the command line, and no gui
applications
- http://support.microsoft.com/?scid=kb;EN-US;153449
- Start the "Client Network Utility"
C:\WINDOWS\system32\cliconfg.exe
- Select the DB-Library Tab
- Deselect "Automatic ANSI to OEM conversion"
- Click OK or Apply

Or inject this registry entry:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\ Client\DB-Lib]
"AutoAnsiToOem"="OFF"

Here are some useful lines from a batch script to query the current
value of the registry and reset if necessary. This is tested on
Windows XP. It will query the registry, throw away the first three
lines of output, and return the value of the third field on the fourth
line. Delims lists one tab character and one space character. Type the
following all on one line:

@FOR /F "SKIP=3 TOKENS=3 DELIMS= " %%A IN ('REG QUERY
HKLM\SOFTWARE\Microsoft\MSSQLServer\Client\DB-Lib /v AutoAnsiToOem') DO
@SET AUTOANSITOOEM=%%A

Type the "reg add" line all on one line:

@IF /i "%AUTOANSITOOEM%" EQU "ON" (
@ECHO
************************************************** **********************
@ECHO ****
@ECHO **** We need to disable "Automatic ANSI to OEM conversion"
@ECHO **** Please see
http://support.microsoft.com/?scid=kb;EN-US;153449
@ECHO **** This only affects isql from the command line
@ECHO ****
@ECHO
************************************************** **********************
@REM
REG ADD HKLM\SOFTWARE\Microsoft\MSSQLServer\Client\DB-Lib /v
AutoAnsiToOem /t REG_SZ /d OFF
)

Alternatively, you must use Unicode script files and osql.

PS: Thank you to Erland Sommarskog for http://www.sommarskog.se and Rob
van der Woude for http://www.robvanderwoude.com

Jan 13 '06 #1
1 11190
Within the FOR command use SKIP=2 on Windows Server 2003

Philip Bondi wrote:
Hello to all SQL Server junkies who work with non-English characters:

For people running scripts from the command line using ANSI files with
special characters, it is very important to use isql and disable
"Automatic ANSI to OEM conversion":
- This only affects isql from the command line, and no gui
applications
- http://support.microsoft.com/?scid=kb;EN-US;153449
- Start the "Client Network Utility"
C:\WINDOWS\system32\cliconfg.exe
- Select the DB-Library Tab
- Deselect "Automatic ANSI to OEM conversion"
- Click OK or Apply

Or inject this registry entry:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\ Client\DB-Lib]
"AutoAnsiToOem"="OFF"

Here are some useful lines from a batch script to query the current
value of the registry and reset if necessary. This is tested on
Windows XP. It will query the registry, throw away the first three
lines of output, and return the value of the third field on the fourth
line. Delims lists one tab character and one space character. Type the
following all on one line:

@FOR /F "SKIP=3 TOKENS=3 DELIMS= " %%A IN ('REG QUERY
HKLM\SOFTWARE\Microsoft\MSSQLServer\Client\DB-Lib /v AutoAnsiToOem') DO
@SET AUTOANSITOOEM=%%A

Type the "reg add" line all on one line:

@IF /i "%AUTOANSITOOEM%" EQU "ON" (
@ECHO
************************************************** **********************
@ECHO ****
@ECHO **** We need to disable "Automatic ANSI to OEM conversion"
@ECHO **** Please see
http://support.microsoft.com/?scid=kb;EN-US;153449
@ECHO **** This only affects isql from the command line
@ECHO ****
@ECHO
************************************************** **********************
@REM
REG ADD HKLM\SOFTWARE\Microsoft\MSSQLServer\Client\DB-Lib /v
AutoAnsiToOem /t REG_SZ /d OFF
)

Alternatively, you must use Unicode script files and osql.

PS: Thank you to Erland Sommarskog for http://www.sommarskog.se and Rob
van der Woude for http://www.robvanderwoude.com


Jan 18 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Miki Tebeka | last post by:
Hello All, I'm shipping an application using py2exe. With Python2.3 it worked fine but when switching to Python2.4 I started getting "warning: string/unicode conversion" all over the place. ...
4
by: Luke Wu | last post by:
I am just wondering what the following terms usually mean: 1) "Standard C" 2) "K&R C" 3) "ANSI C" I am pretty sure "ANSI C" usually refers to the C89 standard, but what
8
by: Dgates | last post by:
Has anyone typed up an index for the O'Reilly book "C# and VB.NET Conversion?" I'm just learning C#, and often using this little book to see which VB.NET terms translate directly to some term in...
7
by: Johann Blake | last post by:
It would be nice to have Visual Studio .NET automatically break into the code whenever an event is generated without having to explicity set a breakpoint. It often happens that when a piece of code...
2
by: George Durzi | last post by:
Hey folks, I just installed VS .NET 2003 on top of Windows 2003 Server. I was opening a Web Project from source control, and got a warning that the project would have to be "converted", and that I...
5
by: Hayato Iriumi | last post by:
When converting a type to another using CType and if the type conversion fails, it throw an exception. However, in C#, there is a keyword "as" which only makes the variable Nothing (null) without...
4
by: Philip Nelson | last post by:
Folks, I've got a database and tablespaces "managed by automatic storage". I've deleted a lot of data from some tables. I've then reorged them. But the tablespaces don't appear to shrink...
8
by: Simon Klein | last post by:
Hi, I've got a problem. I wrote a Program with a Signalhandler Routine. If i use the compile flags "-ansi -pedantic -Wall", "(void) signal(SIGCHLD,Handler)" catches the first signal but ignores...
2
by: paragdi | last post by:
Hi Experts! I am developing heavy mathematical engineering windows application in VB.NET (VS2005) with MSAccess Db. This application has resource files in English, Spanish and German Language. I...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.