DISP_E_UNKNOWNNAME: RECORDCOUNT

Post Reply
User avatar
avista
Posts: 301
Joined: Fri Jun 01, 2007 9:07 am
Location: Macedonia

DISP_E_UNKNOWNNAME: RECORDCOUNT

Post 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:
User avatar
avista
Posts: 301
Joined: Fri Jun 01, 2007 9:07 am
Location: Macedonia

Re: DISP_E_UNKNOWNNAME: RECORDCOUNT

Post 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

 
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: DISP_E_UNKNOWNNAME: RECORDCOUNT

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

Re: DISP_E_UNKNOWNNAME: RECORDCOUNT

Post 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
User avatar
avista
Posts: 301
Joined: Fri Jun 01, 2007 9:07 am
Location: Macedonia

Re: DISP_E_UNKNOWNNAME: RECORDCOUNT

Post 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.
User avatar
avista
Posts: 301
Joined: Fri Jun 01, 2007 9:07 am
Location: Macedonia

Re: DISP_E_UNKNOWNNAME: RECORDCOUNT

Post 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,
User avatar
avista
Posts: 301
Joined: Fri Jun 01, 2007 9:07 am
Location: Macedonia

Re: DISP_E_UNKNOWNNAME: RECORDCOUNT

Post by avista »

I found the problem
Any solution please ?

Regardsm
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: DISP_E_UNKNOWNNAME: RECORDCOUNT

Post by Antonio Linares »

Sometimes oRSet is nil

in your code do:

if oRSet != nil
...
endif
regards, saludos

Antonio Linares
www.fivetechsoft.com
Post Reply