Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.clipper.visual-objects > #10660

Re: ODBC numerics

From James Martin <james@northwoodlumber.com>
Newsgroups comp.lang.clipper.visual-objects
Subject Re: ODBC numerics
Date 2017-06-08 10:02 -0400
Organization A noiseless patient Spider
Message-ID <ohbl7h$n05$1@dont-email.me> (permalink)
References (8 earlier) <ocm37l$20s$1@dont-email.me> <ogq1vn$55e$1@dont-email.me> <oguir7$tnd$1@news.albasani.net> <oh75kq$h0$1@dont-email.me> <oh7630$21q$1@dont-email.me>

Show all headers | View raw


This works:

LOCAL flVal as FLOAT

flVal := Asc(Substr(cVal,7,1))
xVal := (Asc(Substr(cVal,9,1)) * 655.36) + (Asc(Substr(cVal,8,1)) * 
2.56) + (flVal / 100)

RETURN xVal

This works for numbers up to 167119.35 and for 2 decimals.

At least we're going.

James

On 2017-06-06 05:19 PM, James Martin wrote:
> I found it out!
> 
> (2.56 * 2nd number) + (1st number / 100)
> 
> Strange. I'll try this out.
> 
> James
> 
> On 2017-06-06 05:12 PM, James Martin wrote:
>> I am getting output from my code. The ASCII codes are produced by:
>> cVal := Men2String(pTemp,nLen)
>> TellASCI(cVal)
>>
>> TellASCI takes the string and character by character gives the ASCII 
>> code, and then returns a string of them. The input string is 15 
>> characters long and the output string is as follows:
>>
>> 0|  0|254|255|  2|  0| 16| 39|  0|  0|  0|  0|  0|  0|  0|
>>
>> Only the 7th and 8th character change. For example the above was for 100
>>
>> Can anybody figure out a pattern?
>>
>> Number        ASCII codes
>>
>> 1        100,0
>> 1.1        110,0
>> 1.2        120,0
>> 1.3        130,0
>> 2        200,0
>> 3        44,1
>> 3.1        54,1
>> 4        144,1
>> 4.1        154,1
>> 5        244,1
>> 6        88,2
>> 7        188,2
>> 8        32,3
>> 9        132,3
>> 10        232,3
>> 11        76,4
>> 12        176,4
>> 13        20,5
>> 14        120,5
>> 15        220,5
>> 16        64,6
>> 17        164,6
>> 18        8,7
>> 100        16,39
>> 200        32,78
>> 300        48,117
>> 310        24,121
>> 320        0,125
>> 330        232,128
>>
>> James
>>
>> On 2017-06-03 10:58 AM, Jamal wrote:
>>> You need to write:
>>>
>>> dVal  := REAL8( pTemp )      // pTemp is a PTR
>>>
>>> ? AsString(dVal)
>>>
>>> Also, you may have to dig deeper in the SDK especially __GetLongData()
>>>
>>> Sorry, I cannot be more of help since I don’t deal with SQL from VO. 
>>> It's all C# and ASP.NET stuff.
>>>
>>> Jamal
>>>
>>> "James Martin"  wrote in message news:ogq1vn$55e$1@dont-email.me...
>>>
>>> I am now working on this again as I have time. I have noticed that in
>>> the following statement in SQLSelect:GetData (copied from the SDK)
>>>
>>> nODBCType := aSQLColumns[nIndex]:ODBCType
>>>
>>> it returns 30 which is not a handled number in the following DO CASE
>>> statements.
>>>
>>> In reality the values are numbers, floats.
>>>
>>> To debug I opened a file and am writing cODBCType plus the value
>>> Getdata() returns. I added a CASE statement for type 30 and have proof
>>> that it is being selected. However AsString(pTemp) does not return
>>> anything.
>>>
>>> Does anyone have anything suggestions? Is there a way I can look at
>>> pTemp more low level?
>>>
>>> James
>>>
>>> On 2017-04-12 04:41 PM, James Martin wrote:
>>>> OK. I'll try that.
>>>>
>>>> James
>>>>
>>>> On 2017-04-12 02:46 PM, Jamal wrote:
>>>>> Copy the FIELDGET method into your program and instead inherit from 
>>>>> your
>>>>> custom dbServer class for example MyDBServer that inherits from 
>>>>> dbServer.
>>>>>
>>>>> For example:
>>>>>
>>>>> CLASS MyDBServer INHERIT dbServer
>>>>> code your init method accordingly...
>>>>>
>>>>> METHOD FIELDGET(uField) CLASS MyDBServer
>>>>>
>>>>> Then you can debug it.
>>>>>
>>>>> HTH,
>>>>> Jamal
>>>>>
>>>>> "James Martin"  wrote in message news:ocl8ru$ld$1@dont-email.me...
>>>>>
>>>>> How do I enable debug in the SQL SDK Library? The debug lines say 
>>>>> "IFDEF
>>>>> __DEBUG__". However the program does not allow to to define 
>>>>> "__DEBUG__"
>>>>>
>>>>> James
>>>>>
>>>>> On 2016-10-31 04:26 PM, Jamal wrote:
>>>>>> Take a look at the SQL SDK class in VO, specifically the FIELDGET 
>>>>>> method.
>>>>>>
>>>>>> If the field (column) is NIL, the function may return 0.
>>>>>> You will have to debug it the above the method and see what is being
>>>>>> returned.
>>>>>>
>>>>>> Most likely the issue is with the codebase DBF not VO. Doesn't that
>>>>>> vendor have tools to test and display their DBF files.
>>>>>>
>>>>>>
>>>>>> Jamal
>>>>>>
>>>>>> "James Martin"  wrote in message news:nv7lto$egb$1@dont-email.me...
>>>>>>
>>>>>> The database is DBFs by a company called Codebase. If a index is 
>>>>>> present
>>>>>> then a regular DBF program cannot open them since they are a modified
>>>>>> DBF. Data Architect from Advantage does open them (took a copy and
>>>>>> deleted the index) The numerics that it says is Numeric,17,7
>>>>>>
>>>>>> Actually to my surprise, Data Architect does open one of the DBFs. It
>>>>>> shows it to be the VFP driver. I just now tried the CDX driver. 
>>>>>> Its does
>>>>>> not work. It there a VFP driver?
>>>>>>
>>>>>> James
>>>>>>
>>>>>> On 16-10-31 10:02 AM, Johan Nel wrote:
>>>>>>> Martin,
>>>>>>>
>>>>>>> What is the type of the numerical columns in the database?
>>>>>>>
>>>>>>> Remember something about single float, double float issues I had 
>>>>>>> long
>>>>>>> time ago with the VO ODBC classes.
>>>>>>>
>>>>>>> Johan
>>>>>>>
>>>>>>> On 2016/10/31 15:24, James Martin wrote:
>>>>>>>> I created a SQLServer with the VO editor. Then I used it in the
>>>>>>>> bBrowser window this way. The SQLServer uses
>>>>>>>> Type:Numeric,Length:15,Decimals:6 - all by default.
>>>>>>>>
>>>>>>>> LOCAL oBr                 AS bBrowser
>>>>>>>>     LOCAL oDB                 AS ARDETINV
>>>>>>>> *    LOCAL oCol                 AS bDataColumn
>>>>>>>> *    LOCAL oColour             AS bColorCondition
>>>>>>>>
>>>>>>>>     oDB    := ARDETINV{}
>>>>>>>>
>>>>>>>>     IF oDB:Used
>>>>>>>>
>>>>>>>>         oBr := SELF:oDCDataBrowser
>>>>>>>>         oBr:Editable         := FALSE
>>>>>>>>         oBr:CurrentMode     := #Line
>>>>>>>>         oBr:ViewLogicAs := #CheckBox
>>>>>>>>
>>>>>>>>         oBr:Use(oDB)
>>>>>>>>
>>>>>>>>     ENDIF
>>>>>>>>
>>>>>>>> James
>>>>>>>>
>>>>>>>> On 16-10-28 12:41 PM, dlzc wrote:
>>>>>>>>> Dear James Martin
>>>>>>>>>
>>>>>>>>> On Friday, October 28, 2016 at 6:54:28 AM UTC-7, James Martin 
>>>>>>>>> wrote:
>>>>>>>>>> I would like some help.
>>>>>>>>>>
>>>>>>>>>> In the pass I tried to use PostgresSQL via ADO using
>>>>>>>>>> VO2ADO and via ODBC using the VO SQL classes. Both
>>>>>>>>>> times I was able to browse the databases and the
>>>>>>>>>> character fields showed fine. However the numeric
>>>>>>>>>> fields were zero. I thought there was something wrong
>>>>>>>>>> with the drivers for PostgreSQL.
>>>>>>>>>>
>>>>>>>>>> However I am attempting to view another database via
>>>>>>>>>> ODBC and I have exactly the same problem. Is there
>>>>>>>>>> anyone who can give some direction as to what could
>>>>>>>>>> be the problem. The numerics all show zero.
>>>>>>>>>
>>>>>>>>> Can you show us your browse code, and the structure of your 
>>>>>>>>> database?
>>>>>>>>>
>>>>>>>>> David A. Smith
>>>>>>>>>
>>>>>>>
>>>>>>> -- 
>>>>>>> *Johan Nel*
>>>>>>> /Grafx Support Team (Vulcan.NET)/
>>>>>>> George, South Africa
>>>>>>>
>>>>>>
>>>>>
>>>

Back to comp.lang.clipper.visual-objects | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Re: ODBC numerics James Martin <james@northwoodlumber.com> - 2017-04-12 09:11 -0400
  Re: ODBC numerics "Jamal" <noooospam@example.com> - 2017-04-12 14:46 -0400
    Re: ODBC numerics James Martin <james@northwoodlumber.com> - 2017-04-12 16:41 -0400
      Re: ODBC numerics James Martin <james@northwoodlumber.com> - 2017-06-01 17:50 -0400
        Re: ODBC numerics "Jamal" <noooospam@example.com> - 2017-06-03 10:58 -0400
          Re: ODBC numerics James Martin <james@northwoodlumber.com> - 2017-06-05 17:07 -0400
          Re: ODBC numerics James Martin <james@northwoodlumber.com> - 2017-06-05 17:13 -0400
          Re: ODBC numerics James Martin <james@northwoodlumber.com> - 2017-06-06 17:12 -0400
            Re: ODBC numerics James Martin <james@northwoodlumber.com> - 2017-06-06 17:19 -0400
              Re: ODBC numerics James Martin <james@northwoodlumber.com> - 2017-06-08 10:02 -0400
          Re: ODBC numerics James Martin <james@northwoodlumber.com> - 2017-06-08 08:13 -0400
  Re: ODBC numerics "Karl-Heinz" <invalid@invalid.invalid> - 2017-04-13 08:08 +0200

csiph-web