Indexing a DBF
Moderator: Rathinagiri
Indexing a DBF
I'm experienced with Clipper but am an absolute novice with HMG/Harbour. My attempts to open a DBF file with an Index (NTX) utterly fails.
The line "USE <dbf> INDEX <Index>" just doesn't seem to work. The database file opens okay but not in the indexed order. I've tried a variety of methods but my understanding is still too limited to "translate" from Clipper.
Can someone offer a suggestion? I have a lot to learn and am happy to struggle through but occasionally I get stuck on something simple like this. By the way, I have never tried programming in a Windows environment before.
Regards,
Alan
The line "USE <dbf> INDEX <Index>" just doesn't seem to work. The database file opens okay but not in the indexed order. I've tried a variety of methods but my understanding is still too limited to "translate" from Clipper.
Can someone offer a suggestion? I have a lot to learn and am happy to struggle through but occasionally I get stuck on something simple like this. By the way, I have never tried programming in a Windows environment before.
Regards,
Alan
Re: Indexing a DBF
I use:
USE <dbf> NEW SHARED INDEX <index>
But can you post a sample ?
USE <dbf> NEW SHARED INDEX <index>
But can you post a sample ?
- serge_girard
- Posts: 3165
- Joined: Sun Nov 25, 2012 2:44 pm
- DBs Used: 1 MySQL - MariaDB
2 DBF - Location: Belgium
- Contact:
Re: Indexing a DBF
Hi Alan,
First: welcome from Belgium!
Theo's suggestion should work. Maybe you should reindex before. USE syntax has not changed in Harbour/Windosw/HMG so it should work.
Regards, Serge
First: welcome from Belgium!
Theo's suggestion should work. Maybe you should reindex before. USE syntax has not changed in Harbour/Windosw/HMG so it should work.
Regards, Serge
There's nothing you can do that can't be done...
Re: Indexing a DBF
Hi guys. Thanks so much for your welcome and your suggestion. I realised after I got your replies that I hadn't created the indexes for the new DBF file I'd created. I had been working off an old clipper program I wrote about 20 years ago and then decided to modify it greatly using a new database file.
So I've created 2 indexes. Is there a simple way to view the database via an Index without writing a heap of code? I can view the database with LibreOffice Calc but this doesn't give me the indexed list. I'm still very much in testing mode.
Alan
So I've created 2 indexes. Is there a simple way to view the database via an Index without writing a heap of code? I can view the database with LibreOffice Calc but this doesn't give me the indexed list. I'm still very much in testing mode.
Alan
Re: Indexing a DBF
Try this:
Code: Select all
use test index test1
EDIT EXTENDED WORKAREA test
Re: Indexing a DBF
Thanks so much. It's easy when you know how!
Regards,
Alan
Regards,
Alan
Re: Indexing a DBF
Okay last question for the night - (Yes, it's night here in Australia) - I've set up a LABEL / TEXTBOX to get user input to be added to the database. How do I save the TEXTBOX input to the database? The old READ statement in Clipper was so simple!
Alan
Alan
- serge_girard
- Posts: 3165
- Joined: Sun Nov 25, 2012 2:44 pm
- DBs Used: 1 MySQL - MariaDB
2 DBF - Location: Belgium
- Contact:
Re: Indexing a DBF
Hi Alan,
Several ways:
I useally take a 'copy' of the database edit fields. Then a button in order to validate etc. and then my update with the edit-field.
Others use browse and then you can update immediatly.
So it depends on how you will edit!
Samples enough in the samples.
Serge
Several ways:
I useally take a 'copy' of the database edit fields. Then a button in order to validate etc. and then my update with the edit-field.
Others use browse and then you can update immediatly.
So it depends on how you will edit!
Samples enough in the samples.
Serge
There's nothing you can do that can't be done...
Re: Indexing a DBF
Use this code:
Code: Select all
Append blank;
Replace;
Field1 with Form1.Text1.Value,;
Field2 with Form1.Text2.Value
- dragancesu
- Posts: 921
- Joined: Mon Jun 24, 2013 11:53 am
- DBs Used: DBF, MySQL, Oracle
- Location: Subotica, Serbia
Re: Indexing a DBF
Hello asharpham
HMG uses a clipper syntax and the transition should be relatively easy but as it says: every start is difficult
Believe that we all passed it, but the effort is worth it, you will get a lot
Look at the topic I've opened a long time ago, a program that will generate a simple program to work with your dbf table
http://hmgforum.com/viewtopic.php?f=10&t=4170
HMG uses a clipper syntax and the transition should be relatively easy but as it says: every start is difficult
Believe that we all passed it, but the effort is worth it, you will get a lot
Look at the topic I've opened a long time ago, a program that will generate a simple program to work with your dbf table
http://hmgforum.com/viewtopic.php?f=10&t=4170