MOISES wrote:Hi,
but should be T in Access.
dDate := oRs:Fields("Date"):Value // assumes the ado field type = DateTime
cType := Valtype( dDate )
MsgInfo( cType )
cType should = T
MOISES wrote:Hi,
This function with DateTime fields wrongly retrieves such field type as D, but should be T in Access.
Thank you.
#include "fivewin.ch"
#include "adodef.ch"
static oCn
static cTable := "test_datetime"
//----------------------------------------------------------------------------//
function Main()
SetGetColorFocus()
FWNumFormat( "A", .t. )
oCn := FW_OpenAdoConnection( "xbrtest.mdb" )
if oCn == nil
? "Connect Fail"
return nil
endif
if .not. FW_AdoTableExists( cTable, oCn ) .or. ;
MsgYesNo( "Create Table again?" )
CreateTestTable()
endif
EditTable()
oCn:Close()
return nil
//----------------------------------------------------------------------------//
function CreateTestTable()
local aCols := { { "ITEM", "C", 10, 0 }, { "PRICE", "N", 12, 2 }, { "DATETIME", "T", 10, 0 }, { "DESCRIPTION", "C", 20, 0 } }
local oRs
? "Creating Table"
if FW_AdoTableExists( cTable, oCn )
oCn:Execute( "DROP TABLE " + cTable )
endif
FWAdoCreateTable( cTable, aCols, oCn )
return nil
//----------------------------------------------------------------------------//
function EditTable()
local oRs
local oDlg, oFont, oBrw
local nAppendRec := nil
local aStruct := {}
local nField := 0
local csql
oRs := FW_OpenRecordSet( oCn, cTable, adLockBatchOptimistic )
aStruct := FWAdoStruct( oRs )
nField := AScan( aStruct, {|a| Upper(a[1]) == "DATETIME" } )
cSQL := FWAdoFieldType( oRs, nField )
?cSQL
xbrowser ors fastedit
oRs:Close()
return nil
//----------------------------------------------------------------------------//
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 46 guests