Page 1 of 1
DISP_E_UNKNOWNNAME: RECORDCOUNT
Posted: Thu Apr 13, 2017 12:27 pm
by avista
Hi all
This error is produced on win10 64 bit
This program I working good more than 7-8 years under other win versions
Please for solution
Best regards,
Application
===========
Path and name: C:\DbTools\DbTools.exe (32 bits)
Size: 3,651,072 bytes
Compiler version: xHarbour 1.2.3 Intl. (SimpLex) (Build 20141106)
FiveWin Version: FWHX 14.12
Windows version: 6.2, Build 9200
Time from start: 0 hours 0 mins 6 secs
Error occurred at: 13/04/2017, 14:07:45
Error description: Error ADODB.RecordSet/6 DISP_E_UNKNOWNNAME: RECORDCOUNT
Args:
Re: DISP_E_UNKNOWNNAME: RECORDCOUNT
Posted: Thu Apr 13, 2017 12:34 pm
by Enrico Maria Giordano
Can we see a PRG sample showing the problem, please?
EMG
Re: DISP_E_UNKNOWNNAME: RECORDCOUNT
Posted: Thu Apr 13, 2017 12:44 pm
by avista
Thanks for reply
Error is produced at this line
IF !EMPTY( oRSet:RecordCount ) // Vo sprotivno Znaci e 0
Regards,
Code: Select all
//----------------------------------------------------------------------------//
FUNCTION SnimeniKonekcii() // Da se procitaat snimenite konekcii
LOCAL oRSet
LOCAL cSql := ""
cComboIzberiSnimenaKonekcija := "" // Da se resetiraat vrednostite ako se dodade ili izbrisi konekcija
nComboIzberiSnimenaKonekcija := 0
ASIZE( aSnimeniKonekcii, 0)
ASIZE( aComboSnimeniKonekcii, 0)
// cSql := "SELECT * FROM dbtools_sql ORDER BY group,name "
cSql := "SELECT id, name, driver, database, servername, hostname, protocol, service, logonid, password, key, owner "
cSql += "FROM dbtools_conn "
cSql += "WHERE TRIM(owner) = '" + ALLTRIM(sdLogonID) + "' "
cSql += "ORDER BY name "
TRY
CursorWait()
oRSet := TOleAuto():New( 'ADODB.RecordSet' )
WITH OBJECT oRSet
:ActiveConnection := oConnDefault // Konekciite se snimaat na default serverot
:Source := cSql
:CursorLocation := 3 // adUseClient
:Open()
END
CursorArrow()
CATCH oErr
FW_ShowAdoError( oRSet:ActiveConnection )
RETURN NIL
END TRY
// Prvo dodaj DEFAULT konekcija
AADD( aSnimeniKonekcii ,;
{ -1 ,; // ID -1 da ne dojde do problem vo dbtools_conn ...
"DEFAULT " ,;
sDriver ,;
sDataBAse ,;
sServerName ,;
sHostName ,;
sProtocol ,;
sService ,;
Encrypt( sdLogonID , sKey ) ,;
Encrypt( sdPassword, sKey ) ,;
sKey ,;
sdLogonID ;
} ;
)
AADD( aComboSnimeniKonekcii ,;
ALLTRIM( aSnimeniKonekcii[1][2] ) +;
" (" +;
ALLTRIM( aSnimeniKonekcii[1][4] ) +;
"@" +;
ALLTRIM( aSnimeniKonekcii[1][5] ) +;
")" +;
SPACE(200) +;
+STRZERO( aSnimeniKonekcii[1][1] ,7 ) ;
)
cComboIzberiSnimenaKonekcija := aComboSnimeniKonekcii[1] // Inicijalno DEFAULT konekcija
nComboIzberiSnimenaKonekcija := 1 // Sega DEFAULT konekcija e sekogas prva (1)
// Dodaj gi drugite konekcii
IF !EMPTY( oRSet:RecordCount ) // Vo sprotivno Znaci e 0
oRSet:MoveFirst()
DO WHILE !oRSet:Eof()
AADD( aSnimeniKonekcii, { oRSet:Fields("id"):Value ,;
oRSet:Fields("name"):Value ,;
oRSet:Fields("driver"):Value ,;
oRSet:Fields("database"):Value ,;
oRSet:Fields("servername"):Value ,;
oRSet:Fields("hostname"):Value ,;
oRSet:Fields("protocol"):Value ,;
oRSet:Fields("service"):Value ,;
oRSet:Fields("logonid"):Value ,;
oRSet:Fields("password"):Value ,;
oRSet:Fields("key"):Value ,;
oRSet:Fields("owner"):Value ;
} ;
)
AADD( aComboSnimeniKonekcii, ALLTRIM(oRSet:Fields("name"):Value)+" ("+ALLTRIM(oRSet:Fields("database"):Value)+"@"+ALLTRIM(oRSet:Fields("servername"):Value)+")"+SPACE(200)+STRZERO(oRSet:Fields("id"):Value,7) )
IF ALLTRIM( oRSet:Fields("name"):Value ) == "DEFAULT" .AND. ALLTRIM( oRSet:Fields("owner"):Value ) == ALLTRIM( sdLogonID ) // Detektiraj DEFAULT konekcija
cComboIzberiSnimenaKonekcija := ALLTRIM(oRSet:Fields("name"):Value)+" ("+ALLTRIM(oRSet:Fields("database"):Value)+"@"+ALLTRIM(oRSet:Fields("servername"):Value)+")"+SPACE(200)+STRZERO(oRSet:Fields("id"):Value,7)
nComboIzberiSnimenaKonekcija := LEN( aComboSnimeniKonekcii )
ENDIF
oRSet:MoveNext()
ENDDO
ENDIF
oRSet:Close()
RETURN NIL
//----------------------------------------------------------------------------//
FUNCTION ResetirajKonekcii() // Da se procitaat snimenite konekcii ... resetiranje posle dodavanje ili brisenje na konekcii
SnimeniKonekcii() // Ako se dodade ili izmeni da se refreshira
oComboIzberiSnimenaKonekcija:Reset()
oComboIzberiSnimenaKonekcija:SetItems( aComboSnimeniKonekcii )
oComboIzberiSnimenaKonekcija:Select( nComboIzberiSnimenaKonekcija ) // Se azurira vo SnimeniKonekcii()
cComboIzberiSnimenaKonekcija := aComboSnimeniKonekcii[ nComboIzberiSnimenaKonekcija ] // Inaku pri reset ostanuva prazno
oComboIzberiSnimenaKonekcija:Refresh()
SysRefresh()
RETURN NIL
Re: DISP_E_UNKNOWNNAME: RECORDCOUNT
Posted: Thu Apr 13, 2017 12:54 pm
by Enrico Maria Giordano
Sorry, we need a reduced sample that can be compiled and run without changes. I already try one of my samples and found no problem with RecordCount.
EMG
Re: DISP_E_UNKNOWNNAME: RECORDCOUNT
Posted: Thu Apr 13, 2017 1:02 pm
by Rick Lipkin
Avista
Code: Select all
IF !EMPTY( oRSet:RecordCount ) // Vo sprotivno Znaci e 0
A couple of things .. as you probably know ( perhaps from your comment ) .. oRs:RecordCount() returns a numeric value .. you also may have a syntactical error .. ( perhps ) oRSet:RecordCount should be coded like this --- oRSet:RecordCount() with the ending parenthesis.
Suggestions :
Code: Select all
If oRset:RecordCount() > 0 ... or
If !oRset:Eof ....
Rick Lipkin
Re: DISP_E_UNKNOWNNAME: RECORDCOUNT
Posted: Wed Apr 19, 2017 8:04 pm
by avista
Thanks for reply Rick
I have try
If oRset:RecordCount() > 0
and many other options
I use Informix database
May be that is the problem with ado and win 10?
or informix odbc driver ?
In any opinion RecordSet produce error on win 10
Best regards.
Re: DISP_E_UNKNOWNNAME: RECORDCOUNT
Posted: Mon May 22, 2017 8:17 am
by avista
Hi
This error is produced on win10 64 bit is produced when some column in recordset contain non english language characters.
The same error is produced too on other methods
oRSet:MoveFirst()
oRSet:Eof()
....
On other versions of WIN is ok
Some solution ?
Best regards,
Re: DISP_E_UNKNOWNNAME: RECORDCOUNT
Posted: Fri May 26, 2017 1:05 am
by avista
I found the problem
Any solution please ?
Regardsm
Re: DISP_E_UNKNOWNNAME: RECORDCOUNT
Posted: Fri May 26, 2017 7:09 am
by Antonio Linares
Sometimes oRSet is nil
in your code do:
if oRSet != nil
...
endif