Solved

NDX files with Clipper

Posted on 1998-12-08
3
506 Views
Last Modified: 2008-02-07
In our application, we are using Clipper's default NTX files. However, some databases must be published now with MS-Access. If I link these tables, I can't use the NTX index files, since MS-Access is not supporting that.
In Clipper I could use the VIA "DBF" option behind the USE command, however, this results in a "Operation not supported" error message. So, what do I need to do to create NDX files in my Clipper program. (Note : The RDDSETDEAFULT() function is not an option because this applies to all the databases)

Thanks in advance
Rene
0
Comment
Question by:nlnfmrvr
3 Comments
 

Expert Comment

by:pcwhip
ID: 1026077
Do you need to actually create the NDX files in clipper or just access them? Linking in the DBFNDX.LIB should allow you to use an NDX index in clipper....
0
 

Accepted Solution

by:
eefraire earned 50 total points
ID: 1026078
// An example of how to create and open both ntx and ndx files.
//
// To compile and link:
// clipper TNdx /w /n
// blinker blinker incremental off file TNdx lib clipper, dbfndx
//
// The program will create and open the following files:
// FILE1    DBF            67
// INDEX1   NTX         2,048
// FILE2    DBF            67
// INDEX2   NDX         1,024
// FILE3    DBF            67
// INDEX3   NTX         2,048

procedure main()
      request dbfndx

      zmake("dbfntx", "file1.dbf", "index1.ntx")
      zmake("dbfndx", "file2.dbf", "index2.ndx")
      zmake("dbfntx", "file3.dbf", "index3.ntx")

      zopen("dbfntx", "file1.dbf", "index1.ntx")
      zopen("dbfndx", "file2.dbf", "index2.ndx")
      zopen("dbfntx", "file3.dbf", "index3.ntx")
return

procedure zmake(driver, f, i)
      local s := {{"onefield", "c", 1, 0}}
      field onefield
      dbcreate(f, s, driver)
      use (f) via (driver)
      index on onefield to (i)
      close
return

procedure zopen(driver, f, i)
      local mess

      use (f) via driver
      set index to (i)

      mess := padr("  File: " + f, 20) + ";"
      mess += padr(" Index: " + i, 20) + ";"
      mess += padr("   Key: " + indexkey(0), 20) + ";"
      mess += padr("Driver: " + driver, 20)
      close

      alert(mess)
return

0
 

Author Comment

by:nlnfmrvr
ID: 1026079
To both eefraire and pcwhip

Pcwhip answered my question already yesterday, but I was not able to answer after testing his proposal. The clue was linking DBFNDX.LIB

Also eefraire raised this in his/her answer. So you both find the solution for me, but sorry for Pcwhip, I don't know why I can't give you points.

Regards,
Rene

0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Database tuning – How to start and what to tune. This question is frequently asked by many people, both online and offline. There is no hard and fast rule-of-thumb for performance tuning, however, before beginning the tuning process one should a…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now