Solved

NDX files with Clipper

Posted on 1998-12-08
3
533 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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Shadow IT is coming out of the shadows as more businesses are choosing cloud-based applications. It is now a multi-cloud world for most organizations. Simultaneously, most businesses have yet to consolidate with one cloud provider or define an offic…
As technology users and professionals, we’re always learning. Our universal interest in advancing our knowledge of the trade is unmatched by most industries. It’s a curiosity that makes sense, given the climate of change. Within that, there lies a…
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…

856 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