Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

NDX files with Clipper

Posted on 1998-12-08
3
Medium Priority
?
587 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 150 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

Learn Veeam advantages over legacy backup

Every day, more and more legacy backup customers switch to Veeam. Technologies designed for the client-server era cannot restore any IT service running in the hybrid cloud within seconds. Learn top Veeam advantages over legacy backup and get Veeam for the price of your renewal

Question has a verified solution.

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

Your data is at risk. Probably more today that at any other time in history. There are simply more people with more access to the Web with bad intentions.
What we learned in Webroot's webinar on multi-vector protection.
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

916 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