Problem with Connection Pervasive SQL 2000 an MS SQL Server 7.0

Problem with Connection Pervasive SQL 2000 an MS SQL Server 7.0

Post by aaaPau » Mon, 21 May 2001 06:53:45



I want to access Pervasive DB 2000 direktly from SQL Server 7.0 Query
Analyzer:

This is my Query

SELECT * FROM OpenRowSet

'SELECT kdnr,name1 FROM Kunde')

I seem that the problem is caused by some Null-Values, chr0 and so on:

The error message is:

Server: Nachr.-Nr. 7347, Schweregrad 16, Status 1, Zeile 2
OLE DB-Provider 'MSDASQL' gab eine unerwartete Datenl?nge fr Spalte
'[].Bereich' mit fester L?nge zurck. Erwartet wurde die Datenl?nge 52,
zurckgegeben wurde die Datenl?nge 0.

Do you have any idea ?

Do I have to change any parameters in the ODBC ? Null-conversion etc.

 
 
 

Problem with Connection Pervasive SQL 2000 an MS SQL Server 7.0

Post by Bart Dunc » Wed, 23 May 2001 03:02:17


Paul -

This error is generally an indication that the ODBC driver you are using
does not handle either NULL values or empty strings properly.  For
example, it is illegal for the driver to return a value with length 0
when it has previously described the column as fixed-length char(52).  
SQL does meta-data checking as it fetches rows to detect inconsistencies.
 If you have control over the remote database you may consider changing
the column's datatype from a fixed-length character type (char) to a
variable length type (varchar), or create a view that explicitly casts
this column as varchar and select from the view over the linked server.  
This may prevent the problem because the returned length of 0 would be
legal in a varchar column.

HTH -
Bart

--------------------

Newsgroups: microsoft.public.sqlserver.programming
Subject: Problem with Connection Pervasive SQL 2000 an MS SQL Server 7.0
Date: Sat, 19 May 2001 23:53:45 +0200
Lines: 27

NNTP-Posting-Host: p3ee049f5.dip0.t-ipconnect.de (62.224.73.245)
X-Trace: fu-berlin.de 990306296 1348878 62.224.73.245 (16 [38894])
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4522.1200
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200
Path:
cppssbbsa01.microsoft.com!news-out.cwix.com!newsfeed.cwix.com!news.tele.dk
!130.133.1.3!fu-berlin.de!uni-berlin.de!p3ee049f5.dip0.t-ipconnect.DE!not-
for-mail
Xref: cppssbbsa01.microsoft.com
microsoft.public.sqlserver.programming:166073
X-Tomcat-NG: microsoft.public.sqlserver.programming

I want to access Pervasive DB 2000 direktly from SQL Server 7.0 Query
Analyzer:

This is my Query

SELECT * FROM OpenRowSet

'SELECT kdnr,name1 FROM Kunde')

I seem that the problem is caused by some Null-Values, chr0 and so on:

The error message is:

Server: Nachr.-Nr. 7347, Schweregrad 16, Status 1, Zeile 2
OLE DB-Provider 'MSDASQL' gab eine unerwartete Datenl?nge fr Spalte
'[].Bereich' mit fester L?nge zurck. Erwartet wurde die Datenl?nge 52,
zurckgegeben wurde die Datenl?nge 0.

Do you have any idea ?

Do I have to change any parameters in the ODBC ? Null-conversion etc.

 
 
 

Problem with Connection Pervasive SQL 2000 an MS SQL Server 7.0

Post by Paul Kasparbaue » Wed, 23 May 2001 15:54:42


Hi Bart !

Thanks 4 your help.

Do you know, how to change data type to varchar in a pervasive view ?

Select ordernr, paied [varchar] as varchar ??

I dont have any idea

Thanks
Paul

Keywords: Btrieve, Pervasive, ODBC, OLE DB Provider,MS SQL Server, Linkedserver

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

 
 
 

Problem with Connection Pervasive SQL 2000 an MS SQL Server 7.0

Post by oj » Wed, 23 May 2001 17:29:56


Try...

select ordernr, cast(paied as varchar) as paied from yourtable

-oj


Quote:

> Hi Bart !

> Thanks 4 your help.

> Do you know, how to change data type to varchar in a pervasive view ?

> Select ordernr, paied [varchar] as varchar ??

> I dont have any idea

> Thanks
> Paul

> Keywords: Btrieve, Pervasive, ODBC, OLE DB Provider,MS SQL Server,
Linkedserver

> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!

 
 
 

Problem with Connection Pervasive SQL 2000 an MS SQL Server 7.0

Post by Bart Dunc » Thu, 24 May 2001 08:46:16


I'm afraid I'm ignorant of how to do this in Pervasive.SQL.  I believe an
ANSI SQL-92 way of doing it would be:

     SELECT ordernr, CAST (paied AS character varying(30)) AS paied FROM
..

but I don't know if Pervasive supports this syntax.  Maybe someone with
more expertise will chime in...

Bart

--------------------


X-Newsreader: AspNNTP 1.50 (ActionJackson.com)
Subject: RE: Problem with Connection Pervasive SQL 2000 an MS SQL Server
7.0
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit

Newsgroups: microsoft.public.sqlserver.programming
Date: Mon, 21 May 2001 23:54:42 -0700
NNTP-Posting-Host: 63.84.175.221
Lines: 1        
Path: cppssbbsa01.microsoft.com!tkmsftngp01!tkmsftngp03
Xref: cppssbbsa01.microsoft.com
microsoft.public.sqlserver.programming:166472
X-Tomcat-NG: microsoft.public.sqlserver.programming

Hi Bart !

Thanks 4 your help.

Do you know, how to change data type to varchar in a pervasive view ?

Select ordernr, paied [varchar] as varchar ??

I dont have any idea

Thanks
Paul

Keywords: Btrieve, Pervasive, ODBC, OLE DB Provider,MS SQL Server,
Linkedserver

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

--------------------

Date: Mon, 21 May 2001 18:02:17 GMT
Subject: RE: Problem with Connection Pervasive SQL 2000 an MS SQL Server
7.0
Newsgroups: microsoft.public.sqlserver.programming

Paul -

This error is generally an indication that the ODBC driver you are using
does not handle either NULL values or empty strings properly.  For
example, it is illegal for the driver to return a value with length 0
when it has previously described the column as fixed-length char(52).  
SQL does meta-data checking as it fetches rows to detect inconsistencies.
 If you have control over the remote database you may consider changing
the column's datatype from a fixed-length character type (char) to a
variable length type (varchar), or create a view that explicitly casts
this column as varchar and select from the view over the linked server.  
This may prevent the problem because the returned length of 0 would be
legal in a varchar column.

HTH -
Bart

--------------------

Newsgroups: microsoft.public.sqlserver.programming
Subject: Problem with Connection Pervasive SQL 2000 an MS SQL Server 7.0
Date: Sat, 19 May 2001 23:53:45 +0200
Lines: 27

NNTP-Posting-Host: p3ee049f5.dip0.t-ipconnect.de (62.224.73.245)
X-Trace: fu-berlin.de 990306296 1348878 62.224.73.245 (16 [38894])
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4522.1200
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200
Path:
cppssbbsa01.microsoft.com!news-out.cwix.com!newsfeed.cwix.com!news.tele.dk
!130.133.1.3!fu-berlin.de!uni-berlin.de!p3ee049f5.dip0.t-ipconnect.DE!not-
for-mail
Xref: cppssbbsa01.microsoft.com
microsoft.public.sqlserver.programming:166073
X-Tomcat-NG: microsoft.public.sqlserver.programming

I want to access Pervasive DB 2000 direktly from SQL Server 7.0 Query
Analyzer:

This is my Query

SELECT * FROM OpenRowSet

'SELECT kdnr,name1 FROM Kunde')

I seem that the problem is caused by some Null-Values, chr0 and so on:

The error message is:

Server: Nachr.-Nr. 7347, Schweregrad 16, Status 1, Zeile 2
OLE DB-Provider 'MSDASQL' gab eine unerwartete Datenl?nge fr Spalte
'[].Bereich' mit fester L?nge zurck. Erwartet wurde die Datenl?nge 52,
zurckgegeben wurde die Datenl?nge 0.

Do you have any idea ?

Do I have to change any parameters in the ODBC ? Null-conversion etc.

 
 
 

1. Problem with Connection Pervasive SQL 2000 an MS SQL Server 7.0

Problem with Connection Pervasive SQL 2000 an MS SQL Server 7.0

I want to access Pervasive DB 2000 direktly from SQL Server 7.0 Query
Analyzer:

This is my Query

SELECT * FROM OpenRowSet

'SELECT kdnr,name1 FROM Kunde')

I seem that the problem is caused by some Null-Values, chr0 and so on:

The error message is:

Server: Nachr.-Nr. 7347, Schweregrad 16, Status 1, Zeile 2
OLE DB-Provider 'MSDASQL' gab eine unerwartete Datenl?nge fr Spalte
'[].Bereich' mit fester L?nge zurck. Erwartet wurde die Datenl?nge 52,
zurckgegeben wurde die Datenl?nge 0.

Do you have any idea ?

Do I have to change any parameters in the ODBC ? Null-conversion etc.

Keywords: btrieve pervasive oledb provider likedserver

2. CANNOT CONNECT over Enterprise Manager

3. Pervasive SQL 2000 Connection from MS SQL 2000

4. problems with string alignment

5. Migration from Pervasive SQL 2000 to MS-SQL Server 2000 using ADO

6. Screen Tips

7. MS SQL Server 2000 and Pervasive SQL Server

8. Multiple Entries with a sinlge action/click/post

9. Problem with MS Access Runtime 95 AFter Upgrade to SQL Server 2000 (from SQL 7.0)

10. Pervasive.SQL 2000 vs SQL Server 7.0

11. strange ODBC problem with MS SQL 2000 Enterprise Edition, MS SQL 7.0