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


Groups > comp.lang.clipper.visual-objects > #10416 > unrolled thread

Re: ODBC numerics

Started byJames Martin <james@northwoodlumber.com>
First post2017-04-12 09:11 -0400
Last post2017-04-13 08:08 +0200
Articles 12 — 3 participants

Back to article view | Back to comp.lang.clipper.visual-objects

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  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

#10416 — Re: ODBC numerics

FromJames Martin <james@northwoodlumber.com>
Date2017-04-12 09:11 -0400
SubjectRe: ODBC numerics
Message-ID<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
>>
>

[toc] | [next] | [standalone]


#10419

From"Jamal" <noooospam@example.com>
Date2017-04-12 14:46 -0400
Message-ID<oclslq$gmv$1@news.albasani.net>
In reply to#10416
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
>>
> 

[toc] | [prev] | [next] | [standalone]


#10421

FromJames Martin <james@northwoodlumber.com>
Date2017-04-12 16:41 -0400
Message-ID<ocm37l$20s$1@dont-email.me>
In reply to#10419
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
>>>
>>
>

[toc] | [prev] | [next] | [standalone]


#10636

FromJames Martin <james@northwoodlumber.com>
Date2017-06-01 17:50 -0400
Message-ID<ogq1vn$55e$1@dont-email.me>
In reply to#10421
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
>>>>
>>>
>>

[toc] | [prev] | [next] | [standalone]


#10642

From"Jamal" <noooospam@example.com>
Date2017-06-03 10:58 -0400
Message-ID<oguir7$tnd$1@news.albasani.net>
In reply to#10636
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
>>>>
>>>
>> 

[toc] | [prev] | [next] | [standalone]


#10647

FromJames Martin <james@northwoodlumber.com>
Date2017-06-05 17:07 -0400
Message-ID<oh4h0s$nes$1@dont-email.me>
In reply to#10642
Here is the section of GetData that doesn't work:

CASE nODBCType = AQL_NUMERIC .OR. nODBCType - SQL_DECIMAL
	nLen := oData:Length
	cVal := Mem2String( pTemp, nLen)
	xVal := Val( cVal )
	IF UsualType( xVal ) = FLOAT
		nDec := SELF:DataField( nIndex ):FieldSpec:Decimals
		xVal := Rpund( xVal, nDec)
	ENDIF
	FWrite(ptrHandle,AsString( xVal ) + TellASCI( cVal ) + Str (nDec ) + 
"[" + AsString(REAL8( pTemp )) + CRLF)
	RETURN xVal

The FWrite is my code. TellASCI() is also a function I wrote that 
converts the string to a series of ASCII numbers separated by bars. The 
file shows this for the number 162.25:

0  0|  0|254|255|  2|  0|173|115|  0|  0|  0|  0|  0|  0|  0| 
0[*************]

Any thoughts on how to proceed?

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
>>>>>
>>>>
>>>
> 

[toc] | [prev] | [next] | [standalone]


#10648

FromJames Martin <james@northwoodlumber.com>
Date2017-06-05 17:13 -0400
Message-ID<oh4hb3$nes$2@dont-email.me>
In reply to#10642
I Nmade a mistake on the output:

0  0|  0|254|255|  2|  0|161|107|  0|  0|  0|  0|  0|  0|  0| 
0[*************]

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
>>>>>
>>>>
>>>
> 

[toc] | [prev] | [next] | [standalone]


#10650

FromJames Martin <james@northwoodlumber.com>
Date2017-06-06 17:12 -0400
Message-ID<oh75kq$h0$1@dont-email.me>
In reply to#10642
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
>>>>>
>>>>
>>>
> 

[toc] | [prev] | [next] | [standalone]


#10651

FromJames Martin <james@northwoodlumber.com>
Date2017-06-06 17:19 -0400
Message-ID<oh7630$21q$1@dont-email.me>
In reply to#10650
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
>>>>>>
>>>>>
>>>>
>>

[toc] | [prev] | [next] | [standalone]


#10660

FromJames Martin <james@northwoodlumber.com>
Date2017-06-08 10:02 -0400
Message-ID<ohbl7h$n05$1@dont-email.me>
In reply to#10651
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
>>>>>>>
>>>>>>
>>>>>
>>>

[toc] | [prev] | [next] | [standalone]


#10657

FromJames Martin <james@northwoodlumber.com>
Date2017-06-08 08:13 -0400
Message-ID<ohbept$vbs$1@dont-email.me>
In reply to#10642
Need help again.

Asc(Substr(cVal,7,1))/100 doesn't work. Returns 0.
Val(Str(Asc(Substr(cVal,7,1))))/100 doesn't either. Also returns 0.

What I need to do is, for example, convert 64 to .64, 64 being the 
output of Asc()

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
>>>>>
>>>>
>>>
> 

[toc] | [prev] | [next] | [standalone]


#10423

From"Karl-Heinz" <invalid@invalid.invalid>
Date2017-04-13 08:08 +0200
Message-ID<el8j1tFtc4oU1@mid.individual.net>
In reply to#10416
Hi James,

>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__"

__DEBUG__ is a reserved VO word, so you can´t define it. Whether "#ifdef
__DEBUG__" code is compiled or not depends on the internal "debug" setting.
You can change this setting at entity, modul or app-level. Just right click
in the repo at the desired location and select "Properties". -> debug on /
off
.
regards
Karl-Heinz 

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.clipper.visual-objects


csiph-web