field data in database access

field data in database access

Postby damianodec » Thu Jul 07, 2016 9: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,nColStep*80,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 17.09 - Sep. 2017 - Embarcadero C++ 7.00 for Win32
FWH 64 for Harbour 19.06 (MSVC++) Jun. 2019 - Harbour 3.2.0dev (r1904111533)
Visual Studio 2019 - Pelles C V.8.00.60 (Win64)
User avatar
damianodec
 
Posts: 419
Joined: Wed Jun 06, 2007 2:58 pm
Location: Italia

Re: field data in database access

Postby Rick Lipkin » 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
User avatar
Rick Lipkin
 
Posts: 2663
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 54 guests