Re: Funky Error

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Darrick (anonymous_at_discussions.microsoft.com)
Date: 03/04/04


Date: Thu, 4 Mar 2004 05:32:11 -0800

Thanks Erland. You are absolutly right about the remote
DB being on a UNIX platform. The DB is a SIMBA DB, which
can only be accessed through an ODBC driver. (Which makes
it more diffucult). Anyhow, I tried your statement, and
it returned the following error. Do you hav any more
suggestions?

Server: Msg 7321, Level 16, State 2, Line 1
An error occurred while preparing a query for execution
against OLE DB provider 'MSDASQL'.
[OLE/DB provider returned message: [SimbaLNA][Simba]
[SimbaEngine ODBC Driver]Syntax Error.]
[OLE/DB provider returned message: [SimbaLNA][Simba]
[SimbaEngine ODBC Driver]SELECT CAST(SCHEDULE as<< ??? >>
binary(1440)) FROM [/usr/prms/run/db/statdb]..[schedule]]
OLE DB error trace [OLE/DB Provider 'MSDASQL'
ICommandPrepare::Prepare returned 0x80040e14].

Thanks again,

Darrick

>-----Original Message-----
>Steve Kass (skass@drew.edu) writes:
>> I'll take a shot at this. Are you storing data in a
char() or
>> varchar() column that contains non-printable
characters, and in
>> particular, some char(0) values? The char and varchar
types are not
>> meant to store char(0) as data, and the provider is
probably seeing this
>> as an end-of-string marker. If you want to store a
string of 1440 bytes
>> that can include char(0) or any value, my advice is
that you use
>> binary(1440) instead of char(1440), since binary types
are designed for
>> storing arbitrary binary information, unlike character
types, which are
>> used for storing text. Storing binary data in
character types can raise
>> all kinds of issues, like code page conversion,
collations,
>> case-insensitive comparison results, etc, none of which
you probably want.
>
>I tried this on a remote server:
>
> CREATE TABLE baddata (a char(1440) NOT NULL)
> go
> insert baddata (a)
> values (replicate('ABC', 9) + char(0) + replicate
('XUZ', 2))
>
>And I was able to query the remote server with both
MSDASQL and SQLOLEDB
>without getting any error message.
>
>However, looking at Darrick's error message a little
closer, it does
>not seem that his remote server is SQL Server, because
the error message
>says:
>
> [LINKED-TOTALVIEWDB].[/usr/prms/run/db/statdb]..
[schedule].SCHEDULE
>
>Which has a distinct Unix flavour over it. And to get
stuff on Unix to
>understand that char(0) is data and not a string
terminator... Good luck!
>
>One alternative to try could be to use OPENQUERY, as this
could permit
>you to perform the conversion on the remote server. Here
is an example:
>
> SELECT schedule FROM OPENQUERY(LINKED-TOTALVIEWDB,
> 'SELECT CAST(SCHEDULE as binary(1440))
> FROM [/usr/prms/run/db/statdb]..[schedule]')
>
>The syntax may need to be adapted to that other DB engine.
>
>
>--
>Erland Sommarskog, SQL Server MVP, sommar@algonet.se
>
>Books Online for SQL Server SP3 at
>http://www.microsoft.com/sql/techinfo/productdoc/2000/book
s.asp
>.
>



Relevant Pages

  • [NT] Remote PC Access Server DoS Attack Vulnerability
    ... The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com ... Remote PC Access is "fast, compact software for accessing and controlling ... order to crash the remote server or remote system. ... acknowledgment code back to the local client, after this process, by ...
    (Securiteam)
  • Registering a Remote Server With Client Tool
    ... A user at a workstation running the Personal Edition (client tools only) ... register using the sa account & password, ... This Windows user was already defined a a valid trusted login in the remote ... remote server, there is a box checked that reads "Allow other SQL Servers to ...
    (microsoft.public.sqlserver.security)
  • Re: Newbie: 2DCs error 4004
    ... On the remote server, DNS is not configured. ... On the remote server it shows under forward lookup zone: ...
    (microsoft.public.windows.server.dns)
  • RE: Please help, random e-mail replies are rejected
    ... I am afraid you may need to contact the remote server ... with remote server administrator, feel free to let me know. ... This newsgroup only focuses on SBS technical issues. ... you may want to contact Microsoft CSS directly. ...
    (microsoft.public.windows.server.sbs)
  • Re: uucp via tcp through firewall fails
    ... >>UNIX system. ... I had become excited when I begin examining his LAN configuration and the router settings. ... > recall that I had to enable ident and open a port for it 113/TCP. ... An open to port 540 on the remote machine failed. ...
    (comp.unix.sco.misc)