Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Displaying Numeric Values From Sybase Using ASP

3 posts in Windows NT Last posting was on 2001-03-06 20:13:44.0Z
chrisr2 Posted on 2000-11-24 03:06:23.0Z
From: chrisr2@chhlth.govt.nz
Date: Thu, 23 Nov 2000 22:06:23 -0500
Newsgroups: sybase.public.sqlserver.nt
Subject: Displaying Numeric Values From Sybase Using ASP
Message-ID: <11B83E3088C1C4350011104E852569A1.0011105E852569A1@webforums>
Lines: 104
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Path: forums-1-dub!forums-master.sybase.com!forums.sybase.com!webforums.sybase.com!news
Xref: forums-1-dub sybase.public.sqlserver.nt:1466
Article PK: 1088945

Hi

I have created a simple table in Sybase version 11.5. There are no decimal
places allowed for.

field_a numeric(12, 0)
field_b numeric(1, 0)
field_c numeric(2, 0)
field_d numeric(3, 0)
etc.

The table contains one record with the value 2 in field_a, 1 in field_b, 10
in field_c, 100 in field_d, 1000 in field_e, 2 in field_f, 20 in
field_g,etc.

ASP thinks that each field has a defined and actual size of 19.

Using the simple ASP script below I have tried to read the data.

<%@ Language=VBScript %>
<% Option Explicit %>

<!--include virtual="/adoverbs.inc"-->
<%

' Open up a connection to our Access database
' that stores product information

Dim objConn, strConn
strConn = "DSN=ActivityLog;UID=chrisr2;Password=welcome"

set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open strConn

' Create a recordset object instance
Dim objRS
set objRS= Server.CreateObject("ADODB.Recordset")
objRS.Open "temp_table", objConn, , , 2

Dim iLoop
For iLoop = 0 to objRS.Fields.Count - 1
Response.Write "Name - " & _
objRS.Fields(iLoop).Name & "<BR>"
Response.Write "Value - " & _
objRS.Fields(iLoop).Value & "<BR>"
Response.Write "Type - " & _
objRS.Fields(iLoop).Type & "<BR>"
Response.Write "Precision - " & _
objRS.Fields(iLoop).Precision & "<BR>"
Response.Write "NumericScale - " & _
objRS.Fields(iLoop).NumericScale & "<BR>"
Response.Write "DefinedSize - " & _
objRS.Fields(iLoop).DefinedSize & "<BR>"
Response.Write "ActualSize - " & _
objRS.Fields(iLoop).ActualSize & "<BR>"
Next

' Clean up our ADO objects
objRS.Close
Set objRS = Nothing

objConn.Close
Set objConn = Nothing
%>

adoverbs.inc contains :-
Const adOpenForwardOnly = 0
Const adLockOptimistic = 3
Const adLockPessimistic = 2
Const adLockReadOnly = 1
Const adCmdTable = 2

The results I get are :-

Name - field_a
Value - 2
Type - 131
Precision - 12
NumericScale - 0
DefinedSize - 19
ActualSize - 19
Name - field_b
Value - 1
Type - 131
Precision - 1
NumericScale - 0
DefinedSize - 19
ActualSize - 19
Name - field_c
Microsoft OLE DB Provider for ODBC Drivers error '80040e21'
Multiple-step OLE DB operation generated errors. Check each OLE DB status
value, if available. No work was done.
/ActivitiesLog/cr3.asp, line 25

Has anybody got any idea what is causing this and what a work around could
be.

Cheers
Chris


goldingh Posted on 2001-03-06 20:13:44.0Z
From: goldingh@coned.com
Date: Tue, 6 Mar 2001 15:13:44 -0500
Newsgroups: sybase.public.sqlserver.nt
Subject: Re: Displaying Numeric Values From Sybase Using ASP
Message-ID: <B21F0C73E7310285006F1ECD85256A07.001487DB852569A1@webforums>
References: <11B83E3088C1C4350011104E852569A1.0011105E852569A1@webforums>
Lines: 8
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Path: forums-1-dub!forums-master.sybase.com!forums.sybase.com!webforums.sybase.com!news
Xref: forums-1-dub sybase.public.sqlserver.nt:1149
Article PK: 1088602

Did you ever get an answer to this problem ? I am having the same problem
and cant seem to find a solution.

Would appreciate some help...
Thanks much.

Herb Golding
goldingh@coned.com


Rick.Sjogren Posted on 2001-01-18 10:05:34.0Z
From: Rick.Sjogren@Navigator.com.au
Date: Thu, 18 Jan 2001 05:05:34 -0500
Newsgroups: sybase.public.sqlserver.nt
Subject: Re: Displaying Numeric Values From Sybase Using ASP
Message-ID: <6B6464AD7DCC17E200377136852569D8.001487DB852569A1@webforums>
References: <11B83E3088C1C4350011104E852569A1.0011105E852569A1@webforums>
Lines: 10
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Path: forums-1-dub!forums-master.sybase.com!forums.sybase.com!webforums.sybase.com!news
Xref: forums-1-dub sybase.public.sqlserver.nt:1301
Article PK: 1088769

Try setting the .CursorLocation on the connection object from adUseServer
to adUseClientBatch. I found much the same problem with VB, except the same
error occurred when I did a "rst.MoveLast"! This is despite the fact that
the .Supports method shows the same functions for both CursorLocation
types.

As a further wrinkle, using adUseServer with a Static recordset has
.RecordCount returning -1 despite the ADO documentaiton showing that a
recordset that supports the Bookmark feature should return the correct
count of records. And, of course, the .Supports method for such a recordset
does. Go figure!