FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour field data in database access
Posts: 434
Joined: Wed Jun 06, 2007 02:58 PM
field data in database access
Posted: Thu Jul 07, 2016 09:12 AM

hallo,
in a database "mydb.MDB", I have a table MYTBL, in this table there are:
field MYDATA
field MYTIME

I read MYTBL in my source.prg
oDbf := CREATEOBJECT( "ADODB.Recordset" )
oDbf:CursorLocation := 3 //
cQuery := "Select * from MYTBL"
oDbf:Open( cQuery , "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\mydb.mdb, 1, 3 )
...
... then...

oPrn:Say(nRow,nColStep80,dtoc(odbf:Fields("MYDATA"):value),oFont,,,,1) // value is 25/04/2016
oPrn:Say(nRow,nColStep
110,odbf:Fields("MYTIME"):value,oFont) // value is 18:45
...

and print the right value for MYDATA: 25/04/2016 (OK)
but for MYTIME value print blank value

I hope that you can help me

thank you

FiveWin for xHarbour 24.02 - Feb. 2024 - Embarcadero C++ 7.60 for Win32 Copyright (c) 1993-2023

FWH 64 for Harbour 19.06 (MSVC++) Jun. 2019 - Harbour 3.2.0dev (r1904111533)

Visual Studio 2019 - Pelles C V.8.00.60 (Win64)
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: field data in database access
Posted: Thu Jul 07, 2016 12:38 PM

I presume the datatype for MyTime is Char ? .. I would place a msginfo() on your value to see if you are looking at a nil value or just " "

Just to debug and test :

cTime := odbf:Fields("MYTIME"):value
Msginfo( cTime )
Msginfo( valtype( cTime))
Msginfo( len(cTime))

Rick Lipkin

Continue the discussion