|
|||
|
Hi there,
I’m having strange problems with my xHarbour-application using a mixed DBF/ADT-environment. DbSeek () doesn’t work when using ADT-tables. Maybe there is a simple solution. This tiny examples shows my problem: DBF-Table (idx-expression "LAND"): ---------------------------------- TEST_DBF->(OrdSetFocus ("Land")) TEST_DBF->(DbGoTop ()) WHILE ! TEST_DBF->(Eof ()) TEST_DBF->(DbSkip (1) ? „DBF: „, ; TEST_DBF->(RecNo ()),; TEST_DBF->LAND, ; TEST_DBF->(OrdKeyVal ()) ENDDO the result looks fine: DBF: 96 ADN ADN DBF: 106 AL AL DBF: 104 ANG ANG DBF: 49 ARM ARM DBF: 19 AUS AUS DBF: 91 AZ AZ DBF: 2 B B ADT-Table (idx-expression "LAND"): ---------------------------------- TEST_ADT->(OrdSetFocus ("Land")) TEST_ADT->(DbGoTop ()) WHILE ! TEST_ADT->(Eof ()) TEST_ADT->(DbSkip (1)) ? „ADT: „,; TEST_ADT->(RecNo ()),; TEST_ADT->LAND, ; TEST_ADT->(OrdKeyVal ()) ENDDO Result: ADT: 43 ADN äø┬ ADT: 33 AL ä¥& ADT: 35 ANG ä┬¼ ADT: 90 ARM ä█└ ADT: 120 AUS äþ¦ ADT: 48 AZ ä²& ADT: 137 B ò&& My questions: a) Is it possible to do a DbSeek on a ADT-table? b) If yes, what affects the result of OrdKeyVal? Open Mode? Or do I have to create the table differently with “Advantage Data Architect”? Thanks in advance! Thierry |
|
|
||||
|
||||
|
|
|
|||
|
Dear Thierry:
On Friday, July 13, 2012 7:07:06 AM UTC-7, Thierry wrote: .... > Im having strange problems with my > xHarbour-application using a mixed > DBF/ADT-environment. DbSeek () .... you do not explicitly use this function in your code samples. > doesnt work when using ADT-tables. Maybe > there is a simple solution. > > This tiny examples shows my problem: Are the two tables exactly the same, record for record? What RDD are you loading to access ADT. ORDKEYVAL() may not be defined, ormay have some problem. You may have to ask whomever supplied you your RDD, what it can do, and how.. David A. Smith |
|
|||
|
Am 13.07.12 21:17, schrieb dlzc:
Hi David, >> Im having strange problems with my >> xHarbour-application using a mixed >> DBF/ADT-environment. DbSeek () > > ... you do not explicitly use this function in your code samples. Oh, you're right. But I figured out "ordKeyVal" should be theproblem. So I forgot to include a DbSeek in my sample, sorry... DBF-Table (idx-expression "LAND"): ---------------------------------- TEST_DBF->(OrdSetFocus ("Land")) TEST_DBF->(DbSeek ("USA")) -> .T. ADT-Table (idx-expression "LAND"): ---------------------------------- TEST_ADT->(OrdSetFocus ("Land")) TEST_ADT->(DbSeek ("USA")) -> .F. > Are the two tables exactly the same, record for record? 95% / yes. But I've added an autoinc-field to the ADT-file. That's the reason my co-worker wants this table to be in ADT format. He needs a ID-field in his .NET-application. We both have to work on the same database. > What RDD are you loading to access ADT. ORDKEYVAL() may not be defined, or may have some problem. These are my only ADS-related commands: RDDSetDefault ("ADS") AdsConnect60 (cServer, ADS_REMOTE_SERVER, cUser, cPW) AdsSetServerType (ADS_REMOTE_SERVER) All other commands are plain Clipper/xHarbour. DbGoTop / DbGoBottom / DbSkip work fine with ADT-tables. It's just the DbSeek. When using DBF-tables everything is ok. > You may have to ask whomever supplied you your RDD, what it can do, and how. I'm still a little bit confused. I did not install any RDD by myself. I only installed the latest xHarbour-version which includes all the ADS-stuff needed!? Thank you for your help so far. Thierry |
|
|||
|
Dear Thierry:
On Tuesday, July 17, 2012 7:59:13 AM UTC-7, Thierry wrote: .... > DBF-Table (idx-expression "LAND"): > ---------------------------------- > TEST_DBF->(OrdSetFocus ("Land")) ? TEST_DBF->(OrdSetFocus ()) .... is the focus changed? > TEST_DBF->(DbSeek ("USA")) -> .T. > > ADT-Table (idx-expression "LAND" :> ---------------------------------- > TEST_ADT->(OrdSetFocus ("Land")) ? TEST_ADT->(OrdSetFocus ()) .... is the focus changed? > TEST_ADT->(DbSeek ("USA")) -> .F. .... > > What RDD are you loading to access ADT. > > ORDKEYVAL() may not be defined, or may > > have some problem. > > These are my only ADS-related commands: You should also have REQUEST ADS .... before executable code. This may have been done in another way... > RDDSetDefault ("ADS" ![]() > AdsConnect60 (cServer, ADS_REMOTE_SERVER, cUser, cPW) > AdsSetServerType (ADS_REMOTE_SERVER) .... and you probably did handle it another way, since these should not havecomplied without it. > All other commands are plain Clipper/xHarbour. > > DbGoTop / DbGoBottom / DbSkip work fine with > ADT-tables. It's just the DbSeek. When using > DBF-tables everything is ok. > > > You may have to ask whomever supplied you > > your RDD, what it can do, and how. > > I'm still a little bit confused. I did not > install any RDD by myself. I only installed > the latest xHarbour-version which includes all > the ADS-stuff needed!? We got that from ADS, I believe. May or may not be up-to-date. You had asked about: "do I have to create the table differently with Advantage Data Architect?" It looks to me like the index key is encoded / encrypted, perhaps to assurethat clear text only occurs in the data file. Do you recall having made any choices like that in your design? If so, you may have to use the same encoding / encryption on the dbseek() call (which should have been transparent...). Ultimately, I recommend you file a bug report on this, and see if we can get someone's attention besides mine... They will need to know: - what xHarbour you are using - what version of ADS you are using - etc. David A. Smith |
|
|||
|
Hello,
> > I’m having strange problems with my xHarbour-application using a mixed > ADT: 43 ADN äø┬ > ADT: 33 AL ä¥& > ADT: 35 ANG ä┬¼ > ADT: 90 ARM ä█└ > ADT: 120 AUS äþ¦ > ADT: 48 AZ ä²& > ADT: 137 B ò&& Please search on your local computer for a file named adslocal.cfg This is the configuration file for your ADS client, and if you don't have it near your ace32.dll, then it should be added. Open this configuration file with notepad, and read the paragraph related to "ANSI character set", respectively set it up correctly. After saving the new settings with the character set, you need to do a reindex, which might generate some alert messages, but go ahead with reindexing.. Also check the CHCP command's result on your local system in the command window, so to be sure, that the right non-unicode codepage is used. Best regards. Ella |
|
|||
|
Am 17.07.12 22:16, schrieb Ella Stern:
>> I’m having strange problems with my xHarbour-application using a mixed > >> ADT: 43 ADN äø┬ >> ADT: 33 AL ä¥& >> ADT: 35 ANG ä┬¼ >> ADT: 90 ARM ä█└ >> ADT: 120 AUS äþ¦ >> ADT: 48 AZ ä²& >> ADT: 137 B ò&& > > Please search on your local computer for a file named adslocal.cfg > This is the configuration file for your ADS client, and if you don't have it near your ace32.dll, then it should be added. > > Open this configuration file with notepad, and read the paragraph related to "ANSI character set", respectively set it up correctly. > > After saving the new settings with the character set, you need to do a reindex, which might generate some alert messages, but go ahead with reindexing. > > Also check the CHCP command's result on your local system in the command window, so to be sure, that the right non-unicode codepage is used. Yes, I also think it has to do with strange codepage-settings, but I still can't find a solution. server-configuration: ANSI Character Set: German OEM Character Set: GERMAN adslocal.cfg (found this file more than 5 times): ANSI_CHAR_SET=GERMAN OEM_CHAR_SET=GERMAN Tested it with "default" and reindexing. Nothing changed. On the server-config I have to choose a character set and kept "german". CHCP -> 850 In my Code: HB_SetCodePage ("DE850") Also there is NO encryption on indexes or other files. Hmm... Are there any programmers here using ADT-files with normal ISAM-programming and non-default character sets? Thanks, Thierry |
|
|||
|
Ah, just found an unread answer in a different newsgroup from two years ago.
Alex wrote: .... "I'm did found the same problem in my application. After some researching I get to idea that DbSeek() not working with ADS_RAWKEY and this is a point. I have to convert all my indexes to DBF format : ADS_STRINGKEY , so than it's looks like working fine. The problem is that you have to use AdsSeek() function where ADS_RAWKEY involved , so we talking about wrapper for this function." .... But this still doesn't help me. How can I create a "DBF-index" (CDX?)with Advantage Architect? Or maybe there is a AdsSeek-wrapper available now? Thanks, Thierry |
|
|||
|
On Wed, 18 Jul 2012 10:52:44, Thierry <tmblues@tmblues.com> wrote
> >>> I’m having strange problems with my xHarbour-application using a mixed >> >>> ADT: 43 ADN äø? >>> ADT: 33 AL ä¥& >> >Yes, I also think it has to do with strange codepage-settings, but I >still can't find a solution. For what it's worth, I'm not seeing this problem with Harbour and ADS (v8.10 if that makes a difference). DbSeek() works fine on ADT and DBF tables. I definitely experienced screen codepage problems when I tried xHarbour, which was one of the reasons I switched to Harbour. -- Doug Woodrow |
|
|||
|
Dear Thierry:
On Tuesday, July 24, 2012 3:13:07 AM UTC-7, Thierry wrote: > Ah, just found an unread answer in a different > newsgroup from two years ago. > > Alex wrote: > > ... > > "I'm did found the same problem in my application. > After some researching I get to idea that DbSeek() > not working with ADS_RAWKEY and this is a point. > I have to convert all my indexes to DBF format : > ADS_STRINGKEY , so than it's looks like working > fine. > The problem is that you have to use AdsSeek() > function where ADS_RAWKEY involved, so we talking > about wrapper for this function." > > ... > > But this still doesn't help me. ![]() Yes it does. > How can I create a "DBF-index" (CDX?) > with Advantage Architect? Does it have controls for key indexes, and how they are handled and stored? > Or maybe there is a AdsSeek-wrapper > available now? It seems to me, you are just wrapping AdsSeek inside your own call to dbSeek: #include set.ch function dbSeek( uKey, lSoftSeek, lLast ) if valtype( "uKey" ) $ "CDLN" if valtype( "lSoftSeek" ) <> "L" lSoftSeek := set( _SET_SOFTSEEK ) endif if valtype( "lLast" ) <> "L" lLast := .F. && does not matter, AdsSeek ignores this endif return AdsSeek( uKey, lSoftSeek ) endif return .F. This will not help built-in calls to dbSeek (say in tbrowse methods), since they have been pre-linked to the system function. But your calls coded to dbSeek will not have to be updated. Now you can make this smarter by calling the system function if the alias in effect is not ADS, and even calling the system function if ADS_STRINGKEY is in effect. I don't deal with ADS, so I cannot help further. David A. Smith |
|
|||
|
Am 24.07.12 16:35, schrieb dlzc:
Hi David, > return AdsSeek( uKey, lSoftSeek ) sorry, there still is some misunderstanding. As far as I know, there is no "AdsSeek"-function in xHarbour. It's included in ACE32.DLL but not supported by xHarbour. This seems to be my main problem right now. Thanks, Thierry |
|
|||
|
Dear Thierry:
On Tuesday, July 24, 2012 7:50:43 AM UTC-7, Thierry wrote: > Am 24.07.12 16:35, schrieb dlzc: > > > > return AdsSeek( uKey, lSoftSeek ) > > sorry, there still is some misunderstanding. > > As far as I know, there is no "AdsSeek"- > function in xHarbour. It's included in > ACE32.DLL but not supported by xHarbour. This > seems to be my main problem right now. So it is a publically locatable handle in the DLL. You might want to review this thread, where they are accessing a fiscal printer's DLL: https://groups.google.com/d/topic/co...yrk/discussion David A. Smith |
|
|||
|
On Wed, 25 Jul 2012 12:31:29, Thierry <tmblues@tmblues.com> wrote
> > Testing table type 3 > Rec. 2 | FIELD1= 002 | FIELD2= Second | OrdKeyVal= ssy > Value not found: Philosopher's stone > >So, everything looks fine here. Yes, except that OrdKeyVal shows "ssy" instead of "002". >So I've checked all Ads-related stuff and found the problem: > > AdsSetCharType (ADS_OEM, .T.) > >After deleting this line, DbSeek () works fine. But without this line DbSeek () >doesn't work my german umlauts () and DBFs anymore. Yes, I see. The whole OEM/ANSI thing is confusing to me; I think OEM is only there for support of legacy systems. http://harbourlanguage.blogspot.co.u...-codepage.html And it seems the ADT tables do not support OEM character sets: https://groups.google.com/forum/?fro...ur/kLbmOOCh4pI If you leave the Ads char type as ADS_ANSI, does the DBSeek() work if you convert whatever you're seeking using HB_OEMTOANSI() ? -- Doug Woodrow |
|
|||
|
Am 25.07.12 13:28, schrieb Douglas Woodrow:
> On Wed, 25 Jul 2012 12:31:29, Thierry <tmblues@tmblues.com> wrote >> >> Testing table type 3 >> Rec. 2 | FIELD1= 002 | FIELD2= Second | OrdKeyVal= ssy >> Value not found: Philosopher's stone >> >> So, everything looks fine here. > > Yes, except that OrdKeyVal shows "ssy" instead of "002". > >> So I've checked all Ads-related stuff and found the problem: >> >> AdsSetCharType (ADS_OEM, .T.) >> >> After deleting this line, DbSeek () works fine. But without this line DbSeek () >> doesn't work my german umlauts () and DBFs anymore. Ok, it's getting even more strange every new test I'm running. I added "AdsSetCharType (ADS_OEM, .T.)" to YOUR code and this is the result: Testing table type 2 Rec. 2 | FIELD1= 002 | FIELD2= Second | OrdKeyVal= 002 Value not found: Philosopher's stone Testing table type 3 Rec. 2 | FIELD1= 002 | FIELD2= Second | OrdKeyVal= 002 Value not found: Philosopher's stone Please give me some time to think about it. ![]() Maybe it's an interaction between Codepage- _and_ ADS-settings. > If you leave the Ads char type as ADS_ANSI, does the DBSeek() work if you convert > whatever you're seeking using HB_OEMTOANSI() ? I made exactly this test yesterday and it didn't work. ![]() Thierry |
|
|||
|
Am 24.07.12 17:58, schrieb dlzc:
> So it is a publically locatable handle in the DLL. You might want to review this thread, where they are accessing a fiscal printer's DLL: > https://groups.google.com/d/topic/co...yrk/discussion thank you David, this is interesting! |
|
|||
|
On Wed, 25 Jul 2012 14:13:17, Thierry <tmblues@tmblues.com> wrote
>Maybe it's an interaction between Codepage- _and_ ADS-settings. I think you may be right. There's a lot of information on: http://harbourlanguage.blogspot.co.u...-codepage.html It might be a case of setting the correct combination of Set( _SET_CODEPAGE ) and Set( _SET_DBCODEPAGE ) -- Doug Woodrow |
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|