cdmmaui wrote:Dear Rao,
I am loading data in to an array with the SQLLOAD below, however I am getting the following error message, source code below the error message.
// ERROR MESSAGE------------------------------------------------------------------
Application
===========
Path and name: C:\winapps\ual\ualdash.exe (32 bits)
Size: 3,873,280 bytes
Compiler version: Harbour 3.2.0dev (r1801051438)
FiveWin version: FWH 18.02
C compiler version: Borland/Embarcadero C++ 7.0 (32-bit)
Windows version: 6.2, Build 9200
Time from start: 0 hours 0 mins 3 secs
Error occurred at: 05/26/2018, 11:52:55
Error description: Error BASE/1068 Argument error: array access
Args:
[ 1] = C
[ 2] = N 1
Stack Calls
===========
Called from: .\source\classes\DBCOMBO.PRG => TDBCOMBO:FILL( 508 )
Called from: .\source\classes\DBCOMBO.PRG => TDBCOMBO:REDEFINE( 174 )
Called from: ualdash.prg => EDITBILL( 363 )
Called from: ualdash.prg => (b)MAIN( 105 )
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:CLICK( 693 )
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:LBUTTONUP( 944 )
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT( 1721 )
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:HANDLEEVENT( 1909 )
Called from: .\source\classes\WINDOW.PRG => _FWH( 3368 )
Called from: => WINRUN( 0 )
Called from: .\source\classes\WINDOW.PRG => TWINDOW:ACTIVATE( 1043 )
Called from: ualdash.prg => MAIN( 158 )
// Code
REDEFINE DBCOMBO aGet[07] VAR nVessel ID 4007 OF oDlg ALIAS aVessel ITEMFIELD "1" LISTFIELD "2"
//-----------------------------------------------------------------------------
FUNCTION _SqlLoad( cSqlTable )
local oSqlLoad, cSqlLoad := "", aReturn := {}, cDat1 := "", cDat2 := "", cDat3 := "", cToday := "", cYr, cMon, cDay
IF PCOUNT()<1
cSqlTable := ""
ENDIF
AADD( aReturn, "" )
IF EMPTY(cSqlTable)
RETURN aReturn
ENDIF
cSqlTable := UPPER( cSqlTable )
TRY
oSqlLoad:=TOleAuto():New("ADODB.Recordset")
CATCH
MsgWait( "Unable to Load SQL Driver", Ptitle )
RETURN (.F.)
END
// Set...
oSqlLoad:CursorType := 1 // opendkeyset
oSqlLoad:CursorLocation := 3 // local cache
oSqlLoad:LockType := 3 // lock opportunistic
// Set SQL string...
cSqlLoad := "SELECT * FROM vessels WHERE Active=1 ORDER BY [DateCreated] DESC"
TRY
oSqlLoad:Open( cSqlLoad, 'Provider='+xPROVIDER+';Data Source='+xSOURCE+';Initial Catalog='+xDATABASE+';User Id='+xUSERID+';Password='+xPASSWORD )
CATCH oError
MsgInfo("Failed to Connect to the Database" + cEol + cSqlLoad + cEol + oError:Description, Ptitle )
RETURN .F.
END
DO WHILE (! oSqlLoad:BOF) .AND. (! oSqlLoad:EOF)
cDat1 := oSqlLoad:Fields( "id" ):Value
cDat2 := oSqlLoad:Fields( "Vessel Name" ):Value
cDat3 := oSqlLoad:Fields( "Voyage CSA" ):Value
IF (VALTYPE(cDat1)<>"U") .AND. (VALTYPE(cDat2)<>"U") .AND. (VALTYPE(cDat3)<>"U")
AADD( aReturn, { cDat1, ALLTRIM(cDat2) + " V." + ALLTRIM(cDat3) } )
ENDIF
oSqlLoad:Move( 1 )
ENDDO
oSqlLoad:Close()
oSqlLoad:=NIL
RETURN (aReturn)
Error description: Error BASE/1068 Argument error: array access
Args:
[ 1] = C
[ 2] = N 1
Stack Calls
===========
Called from: .\source\classes\DBCOMBO.PRG => TDBCOMBO:FILL( 508 )
nageswaragunupudi wrote:From version FWH 1804, item values can be numeric also ( any datatype )
Function Crea_Listini()
local oListini
Local alist_temp:={}
local nArea := Select()
// create a array of all price list
oListini:= TListini():new()
oListini:gotop()
DO While !oListini:eof()
AaDd(alist_temp,{ oListini:name,trim(oListini:id) })
oListini:skip()
ENDDO
oListini:close()
Select (nArea)
return alist_temp
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 82 guests