Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

NDX files with Clipper

Posted on 1998-12-08
3
Medium Priority
?
571 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

This post looks at MongoDB and MySQL, and covers high-level MongoDB strengths, weaknesses, features, and uses from the perspective of an SQL user.
In today's business world, data is more important than ever for informing marketing campaigns. Accessing and using data, however, may not come naturally to some creative marketing professionals. Here are four tips for adapting to wield data for insi…
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…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

715 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