Solved

NDX files with Clipper

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

SQL Command Tool comes with APEX under SQL Workshop. It helps us to make changes on the database directly using a graphical user interface. This helps us writing any SQL/ PLSQL queries and execute it on the database and we can create any database ob…
Many companies are looking to get out of the datacenter business and to services like Microsoft Azure to provide Infrastructure as a Service (IaaS) solutions for legacy client server workloads, rather than continuing to make capital investments in h…
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…

813 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

11 Experts available now in Live!

Get 1:1 Help Now