DISP_E_UNKNOWNNAME: RECORDCOUNT

DISP_E_UNKNOWNNAME: RECORDCOUNT

Postby avista » Thu Apr 13, 2017 12:27 pm

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

Postby Enrico Maria Giordano » Thu Apr 13, 2017 12:34 pm

Can we see a PRG sample showing the problem, please?

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

Re: DISP_E_UNKNOWNNAME: RECORDCOUNT

Postby avista » Thu Apr 13, 2017 12:44 pm

Thanks for reply

Error is produced at this line

IF !EMPTY( oRSet:RecordCount ) // Vo sprotivno Znaci e 0

Regards,

Code: Select all  Expand view

//----------------------------------------------------------------------------//

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

Re: DISP_E_UNKNOWNNAME: RECORDCOUNT

Postby Enrico Maria Giordano » Thu Apr 13, 2017 12:54 pm

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
Enrico Maria Giordano
 
Posts: 8715
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: DISP_E_UNKNOWNNAME: RECORDCOUNT

Postby Rick Lipkin » Thu Apr 13, 2017 1:02 pm

Avista

Code: Select all  Expand view

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  Expand view


If oRset:RecordCount() > 0   ... or

If !oRset:Eof ....
 


Rick Lipkin
User avatar
Rick Lipkin
 
Posts: 2665
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: DISP_E_UNKNOWNNAME: RECORDCOUNT

Postby avista » Wed Apr 19, 2017 8:04 pm

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

Postby avista » Mon May 22, 2017 8:17 am

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

Postby avista » Fri May 26, 2017 1:05 am

I found the problem
Any solution please ?

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

Re: DISP_E_UNKNOWNNAME: RECORDCOUNT

Postby Antonio Linares » Fri May 26, 2017 7:09 am

Sometimes oRSet is nil

in your code do:

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

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 84 guests