THE INDEPENDENT SOURCE OF NEWS AND INFORMATION FOR PERVASIVE SOFTWARE PRODUCTS

Autumn 1997 • Vol. V No. 3 Pervasive Goes Public 4 Lori Hawkins, a business reporter for the Austin-American Statesman who IPOIPO focuses on software and the Internet, looks at Pervasive Software’s initial public offering. — Lori Hawkins Pervasive Software makes it’s bid to become a publicaly traded company ODBC What It Is? What It Isn’t 6 Understanding ODBC and its history. Jim Kyle offers his insight on what ODBC is, and what it is not. He aslo explains how ODBC works with NewNew Tools!Tools! SQL, addresses some performance issues, and most importantly, discusses whether or not to use ODBC at all. — Jim Kyle Regatta, Smithware, and Yosemite announce new products on page 8 Point Of View 11 Peter Blair, president of Reggatta Systems Inc., conveys his Point of View, in a new column designed to solicit opinions from the Btrieve development commu- EmbeddableEmbeddable nity in a thought-provoking manner. — Peter Blair Why is Btrieve is being marketed Clarion For Windows as an “embeddable” database? 18 BDJ reader, Ayodele Dahunsi, details his search for a simpler and more efficient development platform, and how he converted to Clarion. ODBCODBC — Ayodel Dahunsi

Understanding the ODBC Inside Btrieve interface 22 After stumbling across a white paper called “Migrating Btrieve Applications to Microsoft SQL Server,” on Microsoft’s web page, Doug Reilly examines Microsoft’s intentions toward Btrieve. — Doug Reilly Developer’sDeveloper’s ConferenceConference Embedded Database? 25 What is an embeddable database? Is Btrieve embeddable? Jim Kyle Dates announced, answers these and other “embeddable” questions. — Jim Kyle see page 3! WWhho’o’ss bbeehindhind tthhoosese grgreeaatt eemmbbeeddddeded ddaattaabbaases?ses?

TheThe BestBest inin NAVIGATIONAL: BothBoth WWorldsorlds Btrieve • Highest possible performance for processing speed. • Maximum programming control. • Component management utilities: SmartScout and SupportAbility. It’It’ss us.us. • Call now for promotional pricing! Pervasive Software. Our embedded database engines RELATIONAL: provide the foundation for thousands of client/server applications all over the world. With maintenance-free Scalable SQL ® ® operation, 32-bit Windows NT and NetWare support, • Inscribe: Visual Basic®-compatible ODBC Interface, and the lowest cost of ownership available, they’re great at driving markets, too. scripting tool. Markets like yours. That’s why it will serve you (and • Database-level enforcement of busi- your customers) well to get to know us better. To do ness rules. that, check out our Web site today. • Ease of development. • Call now for promotional pricing!

www.pervasive-sw.com To buy now: 800.287.4383 Btrieve Developer’s Journal From the Publisher... As I write this, Pervasive Autumn 1997: Volume V, Issue 3 Software, Inc. the company that Staff owns Btrieve database technolo- gy, is preparing for their initial Publisher: Scott Smith public offering of stock on the

Editor: Steve Mook y NASDQ. Needless to say, we are quite excited Managing Editor: Kathy Jones about this next step in the evolution of Pervasive Contributors: Kelly Bliss, Craig Bobchin, Lori Hawkins, Jim Kyle, Col. Software as a company, and the implications it

Micro, Doug Reilly, Richard Trocino Steve Lowr has for Btrieve-based technology. I know that Technical Corner: Tim Abels, Ramon Acosta, Linda Anderson, Michael Beris, Publisher, Scott Smith many of you will look to Btrieve Developer’s Bryn Coope, Doris Eldridge, Mike Falcona, Dewitt Gimblet, Mary Halbleib, Don Journal for news about this event, and we intend to bring you the timely Hedding, Scott Henderson, Jeff Johnson, Chad Miller, Chris Ojeda, Lisa information and objective, insightful analysis you have come to expect. In Quintanilla, Joseph Szalay, Dave Valentino, Shiva Waldecker, John Wilkinson, this issue we welcome a new writer who will be covering business issues Stacy Worsham for BDJ. Lori Hawkins is a business reporter for the Austin American- Art Director: Trudy Mook Statesman who focuses on the software and Internet industries. She brings Photographer: Steve Lowry her unique background and perspective to our feature article on the Illustrators: Chris Ferrara, Will Owen, Wes Ware Pervasive IPO in this issue, and we look forward to her contributions in the Administrative Assistant: Jane Carter future. And on the “nuts and bolts” end of the business question, Peter Blair, president of Regatta Systems, a developer tools vendor specializing Subscriptions in Delphi components, offers a few suggestions for the “new” Pervasive Annual subscriptions are for four issues per year at $49/year for delivery inside Software from a developer’s perspective in the Point of View guest column the United States and Canada; $79 elsewhere. on page 11. Back Issues: Back issues are available for $20 per issue. Contact Btrieve A successful IPO will mean inevitable changes for the company. Developer’s Journal at 615-386-3100 for additional information. Pervasive has spent the past three years as a private company working towards a public offering, so company management has been naturally Advertising reluctant to discuss business details either with BDJ or with anybody else. In this respect going public is much akin to pulling one’s pants down for For information about advertising your product or service in Btrieve all the world to see. A stock offering means that the company’s revenues Developer’s Journal, call Kathy Jones, managing editor, at 800-828-7438 or and profits, major customers and perceived competitors, not to mention a 615-386-3100, ext. 17, e-mail: [email protected] great deal of other seemingly trivial information, become part of the public How to Contact BDJ record. For a good example, you can look at Pervasive’s initial filing at http://www.sec.gov/Archives/edgar/data/1042821/0000930661-97- Btrieve Developer’s Journal 001786.txt. 2416 Hillsboro Road, Suite 201, Nashville, Tennessee 37212 As part of the IPO process, Pervasive must make an honest assess- Telephone: 615-386-3100 Facsimile: 615-386-3135 ment both of their market advantages and of their competition. Doug CompuServe: 73173,2731 e-mail: [email protected] Reilly points out in Inside Btrieve (page 28) that if Pervasive is successful Internet: http://www.smithware.com/bdj with its focus on embedded databases and the middle market, very large Btrieve Developer’s Journal (ISSN 1071-7463) is published quarterly by Smithware, Inc. 2416 Hillsboro companies like Microsoft and Oracle may stand up and take notice. As Rd., Suite 201, Nashville, TN, 37212-5318. Subscriptions are $49 per year for delivery in the US and Canada. Doug evaluates Microsoft’s new interest in “embedded databases,” perhaps they have already begun to do so. This will be the nature of business with Postmaster a “public” Pervasive. Being a high-profile company will have a new set of Send address changes to: Btrieve Developer’s Journal, 2416 Hillsboro Rd., Suite 201, advantages and disadvantages, and one of the dangers the company will Nashville, TN, 37212-5318. Copyright© 1997 by Smithware, Inc. All rights reserved. With face may well be its own success. the exception of the “Technical Corner” section, this publication is produced independently And most importantly to us as customers and developers, some wel- of Pervasive Software. No part of this publication may be reproduced in any form, by any come changes are already taking place at Pervasive. As Pervasive’s Chief means without permission in writing from the publisher. Smithware is a trademark of Smithware, Inc. Btrieve and XQL are registered trademarks and Scalable SQL, Xtrieve Technology officer Tim Abels points out in his first Technology Watch con- Plus and Microkernel Database Engine are trademarks of Pervasive Software. All other tribution (page 13), a substantial amount of energy and effort has already names are the trademark of their respective manufacturers. gone into R&D recruitment and activities. It is my hope that this effort and investment in R&D, along with additional capital raised in the IPO, will help Pervasive improve their technology, effectively leverage their existing customer base, and attract new customers, by making their products much Mark Your Calendars! easier to use. Pervasive can accomplish this only by listening carefully to our needs as developers and customers, and acting quickly on our recom- mendations. With the appointment of a new Advisory Council (page 17), and scheduling developer’s conferences in Europe and the U.S. (page 3 and 12), Pervasive has made a good beginning in this direction. So why should developers care what happens on Wall Street? To put it in terms of a Perry Mason rerun, I believe that a successful IPO will give Pervasive the means (additional capital and increased exposure), the motive (price per share and the potential for serious competition), and the uropean Developer’s Conference opportunity to realize their incredible potential as the world-class database company they aspire to be. Ultimately, you will be the judge and jury. April 2-5, 1998 at EuroDisney in Paris, France Look for continuing coverage of the case here in the pages of BDJ.

Pervasive Software Partners Conference Scott A. Smith, publisher Austin, TX [email protected] March 14-18, 1998 Btrieve Developer’s Journal Autumn 1997 3 Pervasive Goes Public By Lori Hawkins [email protected]

In an effort to raise money and visibility, Pervasive Software has filed to sell stock to the public and hopes to be trading in October. Consolidated Statement of Operations Pervasive plans to sell four million (In Thousands) shares of stock at $8 to $10 a share. Of those, two million would be sold by existing share- Year ended June 30 holders and two million would be sold by the 1995 1996 1997 company. Based on a price of $9 a share, the com- Revenues: pany would raise $18 million. Domestic US 5,050 17,747 16,135 The IPO is driven more by a desire to Europe 1,591 12,716 44,693 boost Pervasive’s profile than a need for cash. While the company’s rivals — including Japan 1,656 12,425 22,863 Oracle, Informix and Sybase — have strong Rest of World 1,304 12,588 12,790 name recognition, Pervasive is marketing a product that most people don’t know they’re Total Revenues 8,601 13,476 24,481 using because it’s embedded in other compa- nies’ software products. To compete, analysts Costs and Expenses: say, it needs name recognition. Cost of revenues and “They have a very good, very clever technical support 1,997 12,605 13,310 product, but they don’t have a recognized Sales & Marketing 3,864 16,998 10,034 name,” says industry analyst Dan Kusnetzky with International Data Corp. “They are com- Research & Development 2,339 14,477 15,996 peting with people who have a big name and General administrative 1,996 12,505 12,886 a big budget and a product people know. This battle won’t be won on technology, it’ll be Total Costs & Expenses 9,256 16,585 22,226 won on marketing.” Pervasive officials cannot discuss details Operating Income (loss) .,(655) (3,109) 22,255 of the offering because they are in a “quiet Interest & other income net 9,286 (3,199 22,255 period,” in which their comments are limited by Securities and Exchange Commission reg- Income (loss) before income ulations. Ron Harris, chief executive, said the tim- taxes & minority interest 1(569) (3,010) 22,310 ing was right for an offering. “We closed fis- Provision for income taxes 1(129) 2,(170) 1..(593) cal year ‘97 with a bang, and an IPO is the Minority interest in (earnings) natural next step,” he said. “This is our loss of subsidary, net of tax 9.189 3,1(25) 2..(127) chance to tell the world who we are.” According to documents the company Net Income (loss) 1(609) (3,205) 21,590 filed with the SEC, for fiscal year 1997, Pervasive had earnings of $1.6 million on rev- enues of $24.5 million. That compares with a the symbol PVSW. To seal its separation from Novell, the loss of $3.2 million on revenues of $13.5 mil- The company will use the money for company changed its name to Pervasive lion the year before. general business purposes and possible acqui- Software in July 1996. The name reflects the The company, which is based in Austin, sitions of other companies, products or tech- company’s goal of becoming the embedded Texas, and has 175 employees, has been prof- nologies. In the meantime, it will invest the database in every software application. itable for the past five quarters. proceeds in short-term securities. Today, the company claims thousands of In September, Harris and Jim Offerdahl, Pervasive began in 1982 as a PC data- computer programmers use Btrieve code in Pervasive’s chief financial officer, hit the road base software maker called SoftCraft and was their products. Hundreds of thousands of for a two-week tour across the United States sold to Novell in 1987. Novell slowed its businesses use programs that contain Btrieve and Europe. They pitched the stock to institu- marketing of new database products in the code. tional investors, and tried to get a feel for how early 1990s, and the company was spun off in The IPO will provide the company with much demand there is and how much 1994 as Btrieve Technlogies, Inc. Later that the resources to continue to push into new investors were willing to pay. If all goes as year, the company raised $4.2 million in ven- markets. The company wants to be the market planned, the offering will be made by the ture capital and began its transformation from ruler of databases embedded in Internet appli- time this magazine was printed. The stock a give-away software company to one that cations and home appliances, and it’s spend- will be traded on the Nasdaq market under gets paid. 4 Autumn1997 Btrieve Developer’s Journal Ownership Of The Company’s Stock Before The Offering:

Employees* 27% Nancy & Doug Woodward 35%

Applied Technology 5%

Triad Ventures Limited 5%

Novell, Inc. 11%

Austin Ventures 17% *Includes 2.3 million shares that have been granted to employees as stock options.

ing about 25 percent of revenues on research ual shareholders who want a return on their Corp., Oracle Corp., Informix Corp., Sybase and development to get there. investment. Inc. and IBM.” In the same way that computer chips But Pervasive’s biggest challenge will Sybase in particular, the filing says, have been incorporated into consumer prod- be its competition. Pervasive is playing in a offers a small memory footprint database soft- ucts, Harris envisions putting Pervasive data- large and growing market. Client-server data- ware product, SQL Anywhere, which directly base software in home automation equipment, base software is a $10 billion industry, and competes with Pervasive’s Scalable SQL. hand-held computers, cars and appliances. Pervasive’s arena — small and medium busi- Pervasive’s health is also tied to Novell, “Where we are now is just an absolute nesses and departments within large corpora- which has been struggling through financial starting point,” Harris said in an interview tions — is about $3.5 billion. difficulties. Pervasive gets significant rev- before the IPO filing. “We’re at the infancy of enues from upgrade sales into the NetWare this market and we’ve got a lot of growing installed base. “As a result,” the SEC filing and a lot of pioneering to do.” “We closed fiscal year says, “sales of the company’s products have The company also intends to increase its been and will continue to be influenced by international expansion by opening more for- ‘97 with a bang, market acceptance of NetWare.” eign operations, expanding its international NetWare faces stiff competition from sales channel management and support and and an IPO is the Microsoft’s Windows NT. It’s impossible to hiring more people. Currently, Pervasive has natural next step. predict how Wall Street will receive offices in Frankfurt, Paris, Brussels, Dublin Pervasive’s offering. The company will be and Japan. This is our chance judged both by its own numbers and products With any IPO, there are also risks. It is as well as by issues beyond its control, such not yet clear what percentage of the company to tell the world as the performance of the stock market in Pervasive will sell to the public, but part of its general and Pervasive’s competitors in partic- ownership will shift from venture capitalists, who we are.” ular. founders and company officers to stockhold- Ron Harris Harris, a soft-spoken, 44-year-old soft- ers. CEO, Pervasive Software ware veteran who enjoys deep loyalty from Currently, the largest shareholders are his staff, says he is ready for the ride. founders Doug and Nancy Woodward, with 35 “We’ve been looking forward to this for percent of the stock, venture capitalists, with 27 The company faces tough opponents. a long time,” he says. “We are ready to do it.” percent, employees* with 27 percent and According to its SEC filing: “The market for Underwriters for the offering are Novell with 11 percent. the company’s products is intensely competi- Robertson Stephens, UBS and First Albany. Shifting from a private to a public com- tive and subject to rapid change. The compa- Legal work on the offering is being handled pany will bring the company a whole new ny primarily encounters competition from by the Austin offices of Gunderson Dettmer, audience: institutional investors and individ- large, public companies, including Microsoft and Brobeck Phleger & Harrison.

Btrieve Developer’s Journal Autumn 1997 5 ODBC ODBC WhatItIs,Isn’t 6 interf T tions dealonl m ODBC, r da tur fr those ar tha ODBC dr designed toe ODBC letsasingle da “Open Da Non-tec tem w CompuSer not soeasytoans standar a T da W So quenc da base F X/Open andISO/IEC, er under ODBC f comf SQL da ODBC de eng f y access anODBC-accessib tion isold be decisions a immedia pac ar jimk Jim K ecompiling orr or accessingitspr pplica our bac ir his meetsbothar ame he question -le ultiple da en’ g ta ta fr ta ta al r ha st andf t’ ka inning W ine behind base mana base accesspr base eng s badl v [email protected] API. BasedontheCallLe Man T As thenameimplies, Her Man F F Actuall t m or ace ofw el l t ODBCIsNot: . Bypr g equir hen y o ac or star ha ying SQL.I’ r om amix Autumn1997 y e —b tion usingD d tha ta om anothermembercamether yle ta e r API, hnical computer user ther uc or accessingSQLda e’ k. te need b t IsODBC, y otherless-ser y mana base i . pends uponw taBase Connecti , le withmakingaD v or y designedtobe ” hie ela s justonee v h concer bout usingODBC.Muc ements. F ta inaccur er e ou useODBCtoaccessit. e de ef t f y emost, ter o ine bases sim xpose da ut w and itdoesn’ tional ornonr , v y withtheSQL-basedfunctionstha ha . Oneminorconfusionf viding astandar or ir e thispur g Access). So, although tha xists. s, st a ement systemsusingthesamesour , , v ed ba e “W te elinking g g eloper , oper it w let’ e’ w v . er ob f c a opr v er da ppear ned withusingtheMicr or r A er asonemightthink. the ODBCspecif hitectur te s seemtof e usedneitherD h e oftenf s deter lem e ir asn’ O insteadofODBC, pplica g ofda ms astandar a , y useODBC?” xample: ta ietar st, ting system, ultaneousl the ODBC or incomplete An -or base ca hether y pose ta . Secondl ious misconce ed a B t thew a base eng le da iented f t g v vity” pplica y J yw g t the pur ela t r al r tion dealswithan mine justw er ima rieve Develope the decisionastow in withwillstillbeapoor ta , aced withtheneedtomak i bout thetimeofMS-DOS s ma ta esponse sa A v et Eng the specif tional, diz a base mana “My bossisur equir e mesuc eel tha bases. Mor ta O-vs-ODBC-vs-??? decision. pa v y? and the ou w hole stor el Interf tions m base y ed interf bilities, y seeitasjustanother iconinthe y or g pose ofODBCistoper diz API isinde , ine it’ , h ofther ined fr or langua ements. um r ine da a A . Let’ ica local orr ed wr ant toaccesstheJ om dr , pplica t ODBCistheans O norODBC, D e actor istha ptions a ha y r . Ofcour ica h tr pl tion def tisf occur ust bea A s usedwith.Instead ace (CLI)specif ead g y ace f t constitutesODBC. ” y: not e O quietl . ement systems, ef s r T ta tion imposestw e r a anspar asticall As Btr ied theor the messa tions m osoft Da he ma pper tha base (i.e lect aMicr . “Micr eadil e g y da g ecentl “D pendent ofan visit thesubjectfr emote e or da ing metoimplementthe xtend them. s withincr bout ODBCa r . ines a hether y b A ’ se s Jour le toaccessm y a t ODBCpr ta ent accesstothe ie g t ify O seemslik y usesODBCbehind y dif osoft in , ust bea ic letter ce codewithout y base f ta v it’ t hidesthetr ta v , , ., e de ig so Idon’ g base access, aila desktop ormain it in s not.ODBCis “uni l the da Access Objects e ona inal de ou askD f y designedsys osoft-de e intellig ODBCet Eng er V ou useD w v ica nal ODBCb or w er ent systems. v v mit accessing er toe eloper w le inf v o ar b s standf ented D ented A da y specif sion 5.0. easing fr er hether tions fr le toaccess o , ta ” bound v sal” vides. ine oran a e ahigh hic t f base c T eloper’ pplica v ultiple hitec or A om the ta ent ha v eel s, eloped ue A h an O to er ma base da t’ O or w A ic . om or y s - O e ta - - e s - - - - - a standar thing detail la Ho sions ofthepar ODBC 3.0isthef bit ODBCmana also e Micr f base mana using suc oper sent inan Because ofthis, r mainl CLI specplusaf mer c ing tov bit a implement allnecessar soft hasbeenthepr tionality tha ODBC isalla ar suppor ear f f most r W sion f Also, summer of1994, Interf conce T plete sotheinitialODBCv sho tion. access f m access w functionality ne on theODBCdr thing y aster andmor ea outines. or hang he Cur r ust implementada indo v a th b w tur l w er needtog y competitor ys. s ma pplica a e osoft pr T Using ODBCcannotsud T W ODBC f T . ed upin1991. ace (CLI)specif tions). Ho ea y becauseofcodetuningb xist ontheMacintoshandav es, pts ofthesystem.Ho v ing tov the ODBCa ecent Micr he mostaccur he cur ha ws Contr y theSQL t f er ou cancountonistha hen thepar er ile da tur ter y thinkofitasnothingb ould be t e , d CallLe or standar it r W h f y specif sion 2.5. r although themajor g . tions ar ed fullcompliancewiththeNo xce ent hile thesear er intoafull t’ etained bac ea oducts suc . Suc r ta (suc ir s missingfr ent v er bout. ODBCdr tur e r ption istha st a o totheunder ent specif w sion 2.1notlongafter2.0a V ol P , g s. Micr i it neednottak ob es w osoft pr v e e er ic under er libr b h dr Access Gr the par e fr ir w e v v ppear er mor ppr er ent specif V ut notnecessar d SA el Interf er ust perf ime mo anel, st v sion h asBtr V er sion ofODBC, a ta , oz te g i hen possib er ica oac xtr sion 2.5dr v an ODBCdr base eng y f h as er kw er osoft upg ar sion 1.0esta e aspectsofODBC, en a ed a G f y f as tha tions fr ent specif oducts itcomesonl e thanontheunder ica om theunder and bem h hadg sion tha ener s ma y fr l ea t dr ying eng ar ea w or v ea er ace containingallfunctionsr W ie t ODBC tur tions. bout thetimetha oup (SA ica d compa er behindODBCsinceitsintr e ity ofODBCa tur om Micr t perf mance thandidthosef l sion didn’ i tur aliza v i v indo denl ying eng v y besome v t mosta es. e e ad tions c er er er ine tha om X/OpenandISO/IECw , ed r es lik le ut alsobecausethene ained dominanceo opped 16-bitsuppor r , t full s f or thef ut alibr s ar il aded ODBCto W . tion a y tr a ica ws, ystif or ine (suc y v W t tha i ar or non-SQLeng ela v b . SincesomeODBCfunctions accor anta G). ODBC2.0dr hile thisv mance insuc V tibility witholderdr en’ tions hadf er canimplementthestandar iety ofUNIXpla lished thebasicar e’ e SQLpr hang ansf osoft a y implementsthecur er t suppor ODBC dr l pplica tional eng ine ied b ying da ll looka t full t timethepar bout ODBCw t e sion 2.1.F w g amil ar ding toMicr e ofan , v or ha ed xpected toimplementfunc h asBtr ember 1992standar the y containingda ppear y it. pplica m asimplef y implementthem.Bythe y in32-bitf t slo l the tions commonl ppear , y ofxBaselangua t MS-DOS ying eng y canbef ODBC f er ts a ta imar y’ t thisinabitmor ir i A sion ad base y uniquef w ine v ed andla V med upconsider r h caseswillde t leastminimalSQL er tions in pplica s tobesta e f er thandir ie er or y k v . s anda ines tha or ODBC1.0, v sion 2.0. er an ar fr , tuna T t entir ent CallLe e’ i ine itself with onee osoft, v ould betha ha w v tf e ollo ded quiteaf s e c er ys andda or aster tion pr V or la hitectur equir t’ om thew tel i v s allo er v ter ad ms. er s notw xtended t-f oduction. w umber of m. olv ta-access ea pplica el er r y r y t dir er sion 5 ent v sion ad ed suit, b is 3.0. . ile da , ect da y; lik tur s. Micr le andto T e en’ ed b T T tha equir . o d set w g hus 16- he one his v v es pr ectl g e and es) v pend xce ed anc t com er tions t 16- e ta r ha el t it’ a y the e am ta d b hole ta - b ded e y t - e p o- l er - . e y w s - - - y - . - - ODBC's Architecture application programmers to keep connections open for the life of an application, thus wasting resources in many systems. Newer versions Julius Caesar wrote “All Gaul is divided into three parts.” The

of ODBC retain informationODBC about a connection even after one appli- ODBC architecture takes things one more step, and has four. They’re cation terminates it, making ODBC it less costly to re-open that connection the Applications, the Driver Manager, the Drivers, and the Data and allowing applications to conserve resources by terminating con- Sources. nections immediately after each major transaction. In the mainframe and classic database worlds, an application usu- Besides defining a standard call-level interface, ODBC establish- ally consisted of an entire subsystem that dealt with a business func- es a standard SQL grammar based on the X/Open SQL CAE specifi- tion, such as Payroll or General Ledger. In the ODBC architecture, the cation rather than upon the embedded SQL used by many older appli- meaning is more restricted. An application is any program that calls cations. The two grammars have only minor differences. Extensions to ODBC functions to submit SQL statements and retrieve results. the grammar also expose commonly available language features not The Driver Manager, usually a part of the , loads covered by the X/Open grammar. Applications can use either the drivers on behalf of an application. This component implements all ODBC grammar or a grammar that’s specific to one DBMS. If a state- ODBC functions, although in most cases these are simply pass- ment uses ODBC grammar that differs from that which a specific through calls to functions in drivers. The Driver Manager is either stat- DBMS requires, the driver converts it while sending it to the data ically linked to the application, or loaded by the application at runtime. source. Many engines already use standard SQL grammar and need This lets the application call ODBC functions by name in the Driver make no conversions. Manager, rather than by building pointers into each specific driver. Many PC databases are built on ISAMs, which have a different Each different database engine that ODBC recognizes has at least data model than SQL. Btrieve’s navigational model is a similar archi- one Driver. The driver may be provided by the maker of the database tecture. The major difference is that SQL deals with sets of records, engine, or by a third party. Every ODBC driver processes ODBC func- while the ISAM deals with the procedures for navigation. tion calls received from the Driver Manager, submits SQL requests to Actions such as scrolling, single table operations, and indexed a specific data source, and returns results to the application. If neces- operations are much easier and faster with ISAMs than with SQL. sary, the driver can modify an application’s request so that it conforms Others, such as joins, aggregations, expressions, and general Boolean to syntax supported by the associated database engine. queries, are difficult if not impossible. Neither model is better than the Each ODBC Driver is implemented as a library. A different other is; the choice depends on the features required by the applica- library is required for each engine that supports ODBC. To use a dif- tion. ferent driver, the application need not be modified in any way. Instead, If you’re not familiar with using SQL, you’ll find ODBC opera- the application simply loads the new driver. This allows easy upgrad- tion more than a trifle mystifying. Many good books and references ing of drivers, to reflect improvements to the underlying engines or on SQL exist and you’ll need at least one. I’m partial to the writings simply more effective driver code. of Joe Celko, but that may simply be because I’ve met Joe at confer- To access several engines at the same time, the application can ences and appreciate his humor. load multiple drivers. Driver support is specific to the operating system in use. Windows, for example, implements drivers as dynamic link Some Performance Issues libraries (DLLs). The final element in the ODBC quartet is the category of Data Although ODBC has seen industry-wide acceptance and now Sources. Each Data Source consists of the data the user wants to appears to be a de facto standard for flexible operation, reports of poor access plus its associated operating system, database engine, and net- performance abound. Such reports have surfaced among managers, work platform (if any) used to access the DBMS. database users, and applications programmers alike. Microsoft has A user or data administrator defines each data source within a said, in a white paper on the subject, that most such reports result system, using the ODBC or ODBC32 applet from the Windows from a lack of understanding of the ODBC architecture, improper use Control Panel or equivalent tools on other operating systems. Each of ODBC within applications, and poorly optimized ODBC drivers. Data Source then becomes the equivalent of a complete database, so So far as ODBC performance with Btrieve has been concerned, it is far as ODBC is concerned. The Driver Manager and Driver vanish into my opinion that the primary reason has been poorly designed drivers. the background, and applications then interact with data sources as if The drivers that Microsoft originally supplied for Btrieve made they were connected directly to each other. no use whatsoever of Btrieve’s indexes, which of course are its great- est single performance feature. By forcing all data access to use It’s SQL All The Way sequential searching, this driver slowed the systems down by more than an order of magnitude. Searches that took only seconds using ODBC simply provides a common wrapper around SQL engines, native Btrieve access methods required hours or tens of hours using or implements a SQL engine for systems that do not in themselves rec- ODBC. ognize SQL syntax. Therefore, it shouldn’t come as a surprise to learn Until Pervasive brought out its own ODBC drivers to take full that all communication between an application and an ODBC data advantage of Btrieve’s capabilities, using ODBC with Btrieve was lit- source has to use SQL. Nevertheless, many managers, and not a few tle more than an exercise in futility. Even after Pervasive’s drivers ini- developers, greet this revelation with shock. tially appeared, many users ran into problems. These, however, may The rules an application must follow to interact through ODBC well have involved unfamiliarity with SQL’s approaches in addition to with a data source are simple. First, the application must connect to the normal growing pains associated with initial releases of any prod- the data source. It does so by passing the data source name and any uct. additional information needed to complete the connection to the Currently available drivers make it practical to use ODBC with ODBC Driver Manager library in a standard form. Once the applica- Btrieve files. However many decision-makers, analysts, and indepen- tion has established communication with the data source, it sends one dent software developers still appear to believe that ODBC perfor- or more SQL statements that do the real work of each transaction. The mance is poor. Because of this belief, ODBC is often being positioned application must then end each transaction, either by committing it or as a low-performance solution to be used only when connectivity to by rolling it back. multiple databases is an absolute requirement. Finally, the application terminates the connection when it has fin- That perception, as noted, has some basis in historical fact, but ished interacting with the data source. In early ODBC versions, estab- lishing and terminating connections were costly operations. This led See ODBC, page 10

Btrieve Developer’s Journal Autumn 1997 7 of today’s popular development environments including VB,Delphi, I*net Data Server Moves VC,and C++ Builder. The Java client includes a complete set of Java Btrieve Into the Internet Age classes that delivers full Btrieve functionality to Java applications over Smithware Technology Enables Java,ActiveX,and Traditional the I*net. Smithware even includes a Windows 32-bit DLL client that Btrieve API Development over the Internet works just like the old familiar Btrieve API,so developers who want to deploy I*net applications fast,can Internet-enable their existing appli- NASHVILLE, cations immediately. Tennessee— One company using Smithware IDS technology is MagRabbit, Smithware is Inc.,an Austin,Texas based provider of order fulfillment and support now shipping the services to Novell,Pervasive,and other firms. According to Tim Smithware I*net Belding,MagRabbit systems analyst,“Recently we came across the Data Server Java Classes being developed by Smithware which allow WEB-based (IDS) and the direct Brieve calls. We feel that the use of the IDS and the Java classes I*net Developer’s Kit. The company states that IDS allows Btrieve will greatly simplify our Web-based order entry system.”Belding developers to take their existing development tools and migrate their envisions porting their system completely to Java,allowing internal applications quickly and easily to the Internet. ordering and direct customers orders to use the same Web-based inter- According to Scott Smith,Smithware president and CEO,“The face. Chris Steware,MagRabbit Web master and Internet programmer Smithware IDS truly represents a fresh look at Internet and web appli- added,“Since Java was developed with the Internet in mind,both our cation development. Smithware has taken proven Btrieve client-server Internet security issues and Internet/LAN database programming and development concepts,and moved them directly to the Internet.”IDS integration problems will be minimized using Smithware IDS.” technology allows developers to use the development environment of Approaching I*net development has been simplified further by their choice to build client/server database applications that are scal- Smithware through the introduction of the I*net Partner Program able to the Internet. Smith added,“What really makes IDS unique:is (IPP). Smith explained,“With the IPP,the only requirements to build that you do not have to learn a whole new way to develop in order to and test Internet-enabled applications is the IDS Developer’s Kit and a deliver top notch Internet/Web enabled database solutions today.” connection of any type to the Internet. Users have access to the The Smithware I*net Data Server is an NT service that acts as a Smithware test server (http://ids.smithware.com) where all features of router between users on the I*net (Internet or intranet) and a Btrieve I*net development can be used before any significant investment is made.” server. That Btrieve server can be in the same NT box,or can reside The Smithware I*net Developer’s Kit is shipping now and retails anywhere on the LAN with IDS even on an attached NetWare server. for $595. The Developer’s Kit includes a one-user version of the I*net The IDSDeveloper’s Kit includes three complete sets of client Data Server that can be loaded on Windows NT for local testing if tools that can be used for application development:ActiveX,Java,and desired. For additional information including a complete on-line tour DLL. The ActiveX client in the IDS is drop-in compatible with of IDS,see http://www.smithware.com/ids or contact Smithware at Smithware ActiveX Controls for Btrieve and can be used in almost all 615-386-3100 x6. 8 Autumn 1997 Btrieve Developer’s Journal Smithware Updates Product Line TapeWare 6.0 Release Has Many Crystal Reports 6.0 and DDF Builder 3.0 Plans Outlined New Features NASHVILLE, Tennessee — Smithware has announced that it is in the process of updating two flagship products. FRESNO, California — In early September, the company announced that Smithware Crystal Yosemite Technologies has Reports 6.0 for Btrieve was under development and would ship later in announced that TapeWare, its the year. Steve Mook, Smithware vice president of research and develop- award-winning software, is better ment, indicated that the company was again striving to make sure that and faster than ever. With the Crystal Reports for Btrieve worked perfectly with Btrieve data, and that release of version 6.0, TapeWare the product would again be optimized for maximum performance with is the first network backup soft- Btrieve data. He added that the company “is working on including serv- ware that can back up both er-based record filtering from within the Crystal report drivers so that NetWare and Windows NT servers with a single product. complex report generation can be achieved with increased speed and According to the company, this is a completely new version of reduced use of network resources.” TapeWare and offers a number of innovations that make it the most tech- nologically advanced network backup software available. It offers fea- tures like flexible administration, background operation, and concurrent devices which allow you to run multiple jobs. Designed to be easy to use, TapeWare adapts easily to the existing network configurations. This version of TapeWare should be especially attractive to Btrieve developers and users given the product’s ability to backup open and active Btrieve files on both Windows NT and NetWare servers. To receive a free evaluation copy or for more information, contact Yosemite Technologies at 209-292-8888 or visit http://www.tapeware.com. Exact Software Bundles Btrieve BRUSSELS, Belgium — Pervasive Europe has announced that Exact Software, the “European market leader” in PC-based accounting soft- The user interface of DDF Builder 3.0 has been updated with an Office97 look and feel. ware, has joined its Manufacturing Partner Program (MPP). Smithware also announced plans to ship a new version of DDF Exact has been incorporating Btrieve into its software since 1996. Builder with Smithware Crystal Reports 6.0 for Btrieve. DDF Builder With version 2 for Windows, Exact combines the Btrieve v6.39 3.0 features a complete user-interface redesign and has been updated to client/server and Scalable SQL, delivering an accounting, logistic or be compatible with Office 97. “One of DDF Builder’s best new features manufacturing application and client/server database technology in one is the ability to work with more than one table definition at a time,” convenient package for both Novell NetWare and Window NT platforms. according to Michael Galkovsky, lead developer on the DDF Builder For more information, contact Barbara Baeyens of Pervasive team. “We’ve also given users the ability to edit the DDF definitions Software Belgium at 32-(2)-716-40-44 or [email protected]. directly within the design grid, so building table definitions is much easi- er and more intuitive.” Many of the new features found in Smithware Crystal Reports 6.0 for Btrieve are developer-oriented including better control of the report- ing process from within the developer’s application. New web features, including a new Crystal Web Server as well as better integration with Southdown House Software Limited NetScape and Microsoft web servers, are also included. Smithware did not give an exact ship date for the new versions, but Providing the following specialist Btrieve the company indicated plans to ship before the end of the year. services in the U.K. Contact Smithware at 615-386-3100 x6 or http://www.smithware.com. • Technical Support • Consultancy REGGATTA SYSTEMS OFFERS SUPPORT • Analysis • Installation FOR SCALABLE SQL 4.0 • Optimisation • Training

OAKLAND, California — Reggatta Systems, Inc., developers of Titan Authorized distributors for Btrieve products for Borland’s Delphi and C++ Builder development tools, has released Titan engines that support Pervasive Software’s Scalable SQL 4.0. Titan Btrieve SQL will provide direct support for Smithware, Inc. using Query components in all Borland environments. Peter Blair, president of Reggatta Systems said, “Titan Btrieve SQL AUTHORIZED is the first development tool that provides direct support for Scalable SOLUTION PARTNER SQL without having to resort to low-level API calls. With Titan, the Formerly Btrieve Technologies developer can focus on building their application, not an interface to Scalable SQL.” According to Wayne Brantley, of APrompt Computers, Tel: (01306) 877998 Fax: (01306) 887755 “Titan Btrieve SQL gives me the tools I need to build industrial strength Internet: [email protected] CIS: 100102,145 applications with Scalable SQL as the back-end.” Web: www.southdown.co.uk Titan Btrieve SQL is available now for Delphi 1.0, and the other releases are in beta. Reggatta Systems plans to ship the other releases in Southdown House Software Ltd., Southdown House, October. Reggatta Systems has also just launched Titan SQLAnywhere, Guildford Road,Westcott, Dorking, Surrey, RH4 3NR, U.K. which provides support for Sybase’s SQLAnywhere database engine. For more information, call Reggatta at (616) 384-0830 or visit the Reggatta Systems web site at http://www.reggatta.com. Btrieve Developer’s Journal Autumn 1997 9 ODBC ...continued from page 7 current packages can equal or better the performance of native data- engine’s internals. Only when no such driver exists, or if it fails to base engine code. This isn’t always the case, but happens frequently meet your needs, should it be necessary to go comparison-shopping. enough to be significant. Although some people may expect ODBC to have the same performance going through SQL as with using the The Bottom Line native interface, this simply isn’t true in all cases. However, using SQL as the interface makes operations available that cannot be done At the bottom line, two questions must get answers. Should easily in non-SQL databases. you use ODBC at all? And, if so, how? Instances where ODBC may be slower are related to the In deciding whether to use ODBC you won’t always have a amount of work done under the covers during connection, in order choice. When a client specifies that you use a front end built with to support ODBC capabilities. The single-tier drivers required by Microsoft’s Access, and the data files are in Btrieve, the only practi- engines that do not directly support SQL (such as Btrieve or xBase cal way to meet these requirements will be to use ODBC. When you systems) are generally slower than using the tools native to the do have a choice, remember that ODBC defines a common interface engine involved. The reason is that these drivers must parse and for all of the features it exposes. This means that your applications translate the SQL statements into basic file operations. The degree must use feature-specific, rather than engine-specific, code. Follow to which they slow down depends on how optimized this process is. this rule and you can use any drivers that expose the features you Difference in speed between two different drivers for the same invoke. underlying engine is usually due to differing degrees of optimiza- ODBC can mix and match widely varying databases in an effi- tion. Another reason for slower performance is simply the time nec- cient, high-performance manner. This performance, however, does- essary for the Driver Manager to load the driver DLL. n’t appear automatically. As with any other aspect of software This time will vary from one driver to another, depending on development, getting there requires an understanding of the tools. how the driver was written. Also, some drivers request information This includes familiarity with ODBC itself, with SQL, with the data from the server at connect time. Usually such a driver will expose sources involved, and with all user requirements. If you have this an option to disable retrieval of this information for applications understanding, you’ll find ODBC a useful tool. Without it, you can where those items are not important, which can restore performance expect only continual frustration. equivalent to native API connections. If several different drivers are available, the only way to deter- Jim Kyle has been a professional writer since 1949, an unabashed mine which gives best performance for any specific application is to hacker since 1967, and a desktop-system programmer since 1981. try them all. This isn’t always practical, of course; a reasonably reli- Among the more than 20 books he has written or co-authored is able rule of thumb is to try first the driver that’s produced by the Btrieve Complete. maker of the database engine involved. Nobody else has quite so much interest in wringing the best performance out of that engine, nor is any other firm likely to know quite so much about the

Everything to Btrieve. Btrieve to Everything.

32-bit TM version ® And now, DJ:Engine TM available! Data Junction extracts, transforms, For industrial-strength, scalable, maps & converts your data. enterprise-wide, data conversion DJ:Engine fills the need for a low-cost, All Popular D atabases • All Popular universal, 32-bit, data transformation engine Spreadsheets • Al ASCII Data for NT and UNIX. First, design the conversion with Data Junction for Windows. Next, run the SQL Databases • COBOL Data conversion with DJ:Engine. Thus, super-fast data Bulk Load Formats • ODBC transformations can be deployed on the fastest multi - Legacy Data • Mainframe Data processor servers in native code! Binary/EBCDIC • Packed Data Using Data Junction and DJ:Engin e together exploits 32-bit the best of two worlds. DJWin gives you ease-of-use Record Managers • Btrieve version and maximum design power. DJ:Engine gives you the Accounting Data • C-ISAM available! freedom to execute the conversion on whatever platform makes the most sense. Database Publishing T M On NT or UNIX! Statistical Packages Get Cambio Contact Managers The new text-mining tool Call 800 580-4411 Vertical Software Extracts structured data from. . . or 512 459-1308. ✓ Reports/Printouts ✓ CD-ROM User I/O SDK ✓ Downloads ✓ Email Fax: 512 459-1309 Mailing Lists ✓ Tagged ASCII ✓ Internet text Web: www.datajunction.com Scientific ✓ Screen dumps ✓ Labels TM On Windows , Win95 & NT. . . . and produces a usable database format . Much more From $299 OTJ Cambio converts the dirtiest and most difficult ★★ Visual Mapping & Parsing ✪ Before/After Data kinds of text data into your favorite database. ★ 1996 Browsers ✪ Scores of Date/Time, Text, String Cambio pumps raw text data to ASCII, xBASE, BEST PRODUCT Functions ✪ Batch-Automation ✪ Name/Address Lotus & Excel. For a multitude of target formats AWARD Parsing ✪ Look-up List Functions ✪ Search & and massive filter, edit and mapping power, use Replace ✪ Control Logging ✪ SQL Passthrough Cambio with Data Junction! From $199 2201 Northland Drive • Austin, TX 78756

10 Autumn 1997 Btrieve Developer’s Journal recommendations to Pervasive:

1. Give away for Free the Btrieve Developers Kit in a down-loadable format. Remember Kodak giving away cameras to sell film? Do the same with the Developer’s Kits and charge more for the run-time license if you must. The only downside of this is that there will be more people using Btrieve! How terrible. Since some- one can’t ship applications built with the Developer’s Kit anyway, what is there to lose? My experience has been that very few customers are price sensitive, they just want to try things out without a hassle. I’ll bet even Bill Gates test drives a car first (except perhaps that Porsche that was stuck in Customs when he only had By Peter Blair a billion), and he could afford anything. [email protected] 2. Embrace, promote, sell, and support the third party tools community, as they are the people breathing life into the n the course of selling my products to current and potential core Pervasive products. Customers I talk to want one source BtrieIve developers, I get constant feedback on Btrieve, and Btrieve for their tools, they do not want to go to multiple places to related products. Most of my callers fall into two camps: 1) “Dyed put the puzzle together. Ever try to push through a purchase in wool” Btrieve developers usually converting DOS applications to order to buy something? The only thing worse is to try to put Windows, and 2) “Database neutral” developers looking for a small, through two purchase orders. I knew a guy who tried three fast, reliable, and inexpensive database engine to use with their purchase orders at once, and he had to take a stress leave. application. Today’s buzzword for a product matching this descrip- tion is “embeddable.” 3. Btrieve is the Grand-Daddy of all embeddable database As they say, “You are preaching to the choir” applies to the engines. It was small, fast, reliable, and inexpensive. Don’t first group as they long ago made their commitment to Btrieve. I lose sight of those virtues, as it appears some have been lost am most interested (and Pervasive should be too) in the second in the newest releases. Some would argue that, like some group of developers as they represent the very people that will grow video cameras, there are a whole bunch of fancy bells and the Btrieve development community. By the way, when I refer to whistles that people don’t really need, except for Uncle Btrieve, I am including Scalable SQL developers as well. Fred, who uses the fish-eye lens to make his house trailer Most of the people that call me who are database-neutral have look bigger inside. Many remember fondly version 5.x for called because they have heard about “Btrieve,” “Btree,” or some Windows that was a whopping 60k! other mangled form of the product name. In all cases they have heard good things and want to know more. After I extol all the 4. The image in the marketplace is that all you sell is Scalable virtues of the product and convince them that a Pervasive solution is SQL. What happened to Btrieve? Remember the Alamo, their salvation, they always ask how they can get a free trial ver- and remember Informix. Don’t make the same mistake the did. sion. It is at this point that I start to stutter, and mumble about the several ways that they can do this. Let’s try an analogy to under- 5. Let’s bring back the Btrieve Source Book. Smithware kind - stand where this is headed. ly produced this for awhile, but it did not pay for itself. Suppose you went down to your local electronics superstore, Perhaps Pervasive can sponsor this publication as it sends a let’s call it “The Circuit Guys,” and wanted to buy a video camera. message to every Btrieve user that there is an active commu- You spoke with the sales representative and he stated that he could nity out there using these products, and solving similar prob- sell you the latest “PanaSony,” but you can’t try it out because, lems. At the very least, include third party vendor advertise- some of the parts are actually at “Radio Shed,” you need to license ments in the box. the tape from “3.5M,” and you’ll have to get your own electricity as it does not use AC or DC, but instead “EC,” which has something to My comments above echo the sentiment of the people I talk to do with Europe. You’ll probably need a lens too, but that cost extra, on the phone everyday. I am not trying to be critical at all, but and you’ll hardly ever need one, as the camera will be in the box instead offering a sort of wake up call of the likes the people of most of the time. Pompeii might relate to. As for third party vendors (like myself, Finally, you’ll have to pay every time you show your movie as guilty as charged), I have heard the following: this cost the camera manufacturer extra for some reason. Sadly, you have a ton of money, but you won’t spend a dime until you can 1. Where our products are complimentary, offer joint market- try it out. Are you interested? Would you like a service agreement? ing, bundles, and the like to make it easier for people to get People want simplicity, not complications. going with Btrieve. I’ll let you apply the analogy to working with Btrieve products See POV, page 21 and third party utilities, but there are several things that can be done by Pervasive and third party vendors to improve the situation. First,

Btrieve Developer’s Journal Autumn 1997 11 Southdown House Software Limited We’ve Moved! When BUTIL won’t bring back your data ... Visit our new Web site at contact http://www.southdown.co .uk Jim Kyle ATTENTION UK COMPANIES author of “Btrieve Complete” effective data recovery specialist Make sure you’re listed in the directory of UK companies of fering Btrieve and E-mail: [email protected] Scalable SQL based products and services - Fax: (405)728-3312 Visit our Web site and get listed. Voice: (405)728-3316

Post Your Message on the BDJ Bulletin Board! For more information, contact Kathy Jones, Managing Editor, Btrieve Developer’s Journal, 800-828-7438 or 615-386-3100 ext. 17 e-mail: [email protected]

Pervasive European Events Event Date Location Info Comdex + Oct 7-9 Frankfurt, Pervasive Germany Events Object World Germany +49-6172-92-58-30

Software Oct 22-23 Utrecht, Pervasive Belgium Pervasive Software will be participating in the Automation Netherlands +32-2-716-40-44 following events:

Infopor Oct 22-26 Libson, Marta Correra/Danysoft Event Date Location Portugal +34-1-654 6298 Fax +34-1-654-6382 Magic Software Sep 24 Thailand Expo Gitex Oct 29- Dubai, Pervasive France Nov 2 United Arab +33-1-46-69-79-55 Emirates Networld + Interop Oct 8-10 Atlanta, GA Novell Pavillions

SIMO Nov 4-9 Madrid, Marta Correra/Danysoft Fair Isaac & Co. Oct 14-17 Tucson, AZ Spain +34-1-654 6298 “Automated Systems Fax +34-1-654-6382 vasive Users Exchange”

Snap Seminar Nov 21 Johannisburg Pervasive Germany Pervasive Software Mar 14-18 Austin, TX South Africa +49-6172-92-58-30 Partners Conference 1998

For more information contact: Trish Manning, European April 2-5 EuroDisney France Pervasive Software, Events Coordinator, Developer’s 1998 [email protected] or 512-794-1614.

Conference Per

12 Autumn 1997 Btrieve Developer’s Journal Formerly Btrieve Technologies TECHNICAL CORNER

Autumn 1997 SUPPLEMENT TO BTRIEVE DEVELOPER’S JOURNAL

TECHNOLOGY WATCH FYI

The first words of the first column are a In short, my vision is: Adding Scalable SQL 4 to a Btrieve 6.1x hearty thanks to Doug Woodward, who creat- Environment ed our unique, market-leading database. •To define and lead middle-market Scalable SQL; Btrieve for NetWare/Btrieve for Doug and Nancy Woodward’s knowledge of focus of no DBA, ease of use, perfor- Windows NT, v4.0; 6.1x our product, channel, and customer family mance, small footprint, and cost of will remain one of Pervasive Software’s major owner ship, as measured by customer ISSUE: What are the issues associated with assets. I will continue satisfaction and volume. mixing Scalable SQL 4 and Btrieve 6.15 in a to solicit their insights •To solidify technology leadership in network environment? on every major archi- performance, ease of use, and reliabili- tectural and product ty as measured by winning competitive SOLUTION: When Scalable SQL 4 is direction. reviews. installed in a NetWare or Windows NT server To stay focused on the aspects of the Second, I want to • environment, the following server compo- business that has made us successful reiterate our continued nents will be provided: customer focus. I was (i.e. avoid data warehousing, object ori- telling an editor with ented databases, and terabyte databas- es). • Scalable SQL 4 Engine VAR Business in June • Scalable SQL 4 Communications about the cult-like loy- My highest initial priorities have been to Module alty and bond with our customers that few • MicroKernel Database Engine v7.0 other companies enjoy. I personally look for- solicit customer feedback, recruit a world- class development team, implement leading • Btrieve Access Module v6.30 ward to an industry-leading level of customer Btrieve Communications Module quality assurance processes, and lead strategic • visits, conference attendance, and e-mail cor- v6.30 respondence to: [email protected] to product planning. I have recruited the following industry- guarantee that you refine the focus of our Scalable SQL 4 requires the 7.0 middle market products. Since I started leading senior developers since March: Jim, CompuServe Sr. Quality Assurance Manager; MicroKernel Database Engine (MKDE). March 3rd, I have visited multiple customers The v6.30 Btrieve Access Module allows in seven states, attended seven conferences, Robert, IBM and Tandem Sr. MicroKernel architect with nine patents; Allen, TI project existing 6.x-compatible Btrieve applications and soon expect over 100 customer/partner e- to run in this environment as long as the mails a day. I will also be presenting at Fall leader of Microsoft Repository and formerly IEF; Yanmin, UniSQL database developer and appropriate 6.x Btrieve requesters are avail- Comdex, PC World, and Internet World. able for these applications. Scalable SQL 4 Please e-mail me, so we can meet at any of a Ph.D. from Case Western; Tom, IBM Sr. per- does not include Btrieve requesters, only these. formance tuning with DB2 and IBM Micro- Scalable SQL requesters. The Btrieve You’ll soon find that my style is all over kernel systems; Barrett, Sr. Systems program- requesters from Btrieve 6.15.x installation the map, with a speed and creativity that is mer from Intel and Tandem; Scott, Sr. network- can be used in conjunction with the Btrieve uncomfortable for most people. A cause of ing developer with Internet companies server components provided with Scalable (or symptom from) this is having seven kids, Chisholm and Hal; Calvin, Sun Microsystems SQL 4. Do not attempt to use any of the ages two to 17, that my wonderful wife and I developer; Raymond and Robert, UniSQL Btrieve 6.1x server components in conjunc- home school. Let the record show that I wait- database developers; Guy and Keith, IBM Sr. tion with Scalable SQL 4. ed two whole paragraphs before bragging systems developers; David, internationaliza- If Scalable SQL 4 is running in a distrib- about my family. The more you know me, the tion developer now at our Dublin, Ireland more you’ll admire anyone who puts up with office; and Mairi, research analyst and web- uted data environment, there is an issue to be me. master. considered. For example, if Scalable SQL 4 is Although http://www.pervasive-sw.com We have made similar recruiting success- running on Server 1 and data to be accessed gives my detailed background, I will be giving es in quality assurance, which I’ll detail in by Scalable SQL resides on Servers 1 and 2, more specifics as requested by BDJ readers or future columns. Scalable SQL will issue Btrieve requests for as it relates to this column. The local Austin On a personal note, after much paper- data, when appropriate, to either the local paper quoted my short version on May 19: “I work our Labrador, Shadow, finally joined us. MicroKernel Database Engine on Server 1 or came to Pervasive Software because it is a He comes from Redmond three months late, to the remote database engine on Server 2. If very focused company that is poised to 20 pounds heavy, and has a new attitude that Server 2 is running a 7.0 MicroKernel become a much, much larger company.” ignores feedback. Database Engine, everything will function as This initial column gives context to future expected. If Server 2 is running a 6.15 or Tim Abels articles by summarizing my vision, initial pri- older database engine, Scalable SQL 4 (on Chief Technical Officer orities, and long term goals. Server 1) will be able to successfully read Pervasive Software Btrieve Autumn1997 13 data from Server 2, but will not be able to ISSUE: The ODBC Interface v1.0x for SOLUTION: There is a SQLRequester Win32 write data (insert, update, or delete) to Server Windows 95 shipped with a thunking DLL registry setting for number of logins. 2. Attempting to do so will result in a Status named WSSQL32.DLL (16K). This DLL uses ODBC32 internally defaults the setting to 3 Code 41, “Operation Not Allowed”. the same name as the Scalable SQL 4 logins, 5 tasks. Scalable SQL 4 requires the functionality of requester. A status 802 may result when The Scalable SQL interface for the the 7.0 MicroKernel Database Engine in attempting to connect to a Scalable SQL Windows 95 ODBC v1.03 driver was 16-bit order to modify data files. If this functionality server engine using the 32-bit path. and used the BTI.INI file. The 32-bit ODBC is required on a remote server, the 7.0 data- (SQLSCOPE.EXE thunking to the 32-bit v2.0 uses a 32-bit Scalable SQL interface base engine, the 6.30 Btrieve Access Scalable SQL layer for example). and reads keys from the registry. Module, and the 6.30 Btrieve Communica- The ODBC Interface v2.x install will Try increasing the logins to 10 and tasks tions Module must be running on Server 2. remove the legacy file if it is at the default to 7 in the BTI.INI or Registry: These components are currently available install path (\windows\system). However if with Scalable SQL 4. the file has been moved, the legacy 1. Open the registry. WSSQL32.DLL may remain in the path. Passing an invalid DATEFORMAT value 2. Navigate to: My Computer\HKEY_ returns status 509 SOLUTION: Delete the legacy 16k version LOCAL_MACHINE\SOFTWARE\ Scalable SQL, v4.00 of WSSQL32.DLL and/or install ODBC PERVASIVE SOFTWARE\Scalable Interface v2.00. SQL Requester\Settings ISSUE: The SQL Statement SET DATEFOR- MAT = ‘mmddyyyy’ returns status 509. The Basic ODBC API code troubleshooting 3. Set Logins to 10 set statement is invalid. As a result, date2 + ODBC, v1.x, 2.x 1 shows as 01/01/** (date2 is 12/31/1999) 4. SetTasks to 7 and date3 + 1 shows as 12/14/** (date3 is ISSUE: Customers frequently have problems 12/13/2001) implementing a specific ODBC API. For 5. Exit the Registry. example: SQLBindParam not working with SOLUTION: The specified dateformat value CHAR data types. ‘Setup routine cannot be run’ error with is invalid; only mdy, myd, dmy, dym, ymd, ODBC 2.0 ydm are valid. This statement is intended to SOLUTION: The key to debugging such ODBC 32-bit Interface, v2.x be used to specify the ordering of the parts problems is to use the ODBCTest program of the date value, not the appearance of bundled with Microsoft ODBC SDK, com- ISSUE: After successfully installing ODBC each of the parts. So, if you just want to use bined with a spy utility like Dr. DeeBee. 2.0 and attempting to setup a data source, a 4-digit year when displaying date values the error message ‘setup routine cannot be then ANY valid dateformat value will work, Example Debugging steps: run’ appears when the Pervasive Software since after using the SET DATEFORMAT ODBC interface is selected using the ODBC statement successfully, all dates with no 1. Run successful code sample with administrator under Windows 95 or mask are displayed with a 4-digit year. If an ODBCspy trace turned on. Windows NT. you want the value displayed as month, day, year, then use “SET DATEFORMAT = ‘mdy’”. 2. Run problem code sample with SOLUTION: This happens because of To force the display to only use a 2-digit another ODBCspy trace. the way these two operating systems handle year, use “SET DATEFORMAT=NULL”. ==>Compare trace files. pathing within the OS for 32-bit applica- tions. Serial number synchronization error 3. Step through the problem sample Copy or move *.DLLs from /BTI/WIN32/BIN to /system (or system32).

ISSUE: After successfully installing Scalable 4. Work in ODBCtest until varying the Microsoft Reserved Error -7716 With ODBC SQL 4.0, when trying to install the user call params returns success. ODBC, v2.x count increase, a ‘Serial Number synchro- nization error’ may occur. 5. Look at the successful trace and ISSUE: Using Microsoft Access 95/97 with migrate steps to code base. the Pervasive Software ODBC Interface and a SOLUTION: This error occurs because all Scalable SQL server engine, some operations components of the previous install have not ODBC Admin returns a second time, login may return a Microsoft reserved error -7716. been removed. All previous and new com- fails This error is returned when the Scalable SQL ponents must be removed, and Install must ODBC, v1.x, 2.x server engine Communications Buffer Size is be run again. SupportAbility can be used to not large enough to process the data being ensure all components are removed prior to ISSUE: Attempting to login to an ODBC requested by Access. re-installing. Since user count increases are datasource will cause the ODBC Admin stored on disk and the disk is written to so it screen to appear, similar to when a data- SOLUTION: Run the Scalable SQL setup cannot be used again (even if the user count source can not be found. Clicking to utility for the server engine and increase is not successfully installed), you may need continue will cause a general ODBC failed the Scalable SQL Communications Buffer another user count key. The user will get a error. Size to the maximum (or at least 32K). It is message stating the key has already been The login screen will re-appear as a also recommended that the Scalable SQL used. You will need to contact Pervasice response to any failed login, and may return workstation requester Communications Software support for a new key. a status 2104, logins exceeded. Buffer Size be set the same as the server Please note that some Microsoft dynaset engine (consult your product documentation ODBC / RDO operations will use as many as 6 for specifics on how to set this for your prod- Error 802 with legacy ODBC Wssql32.dll logins. uct). The -7716 error should no longer occur. ■ ODBC, Scalable SQL, v4.0, v2.x

14 Autumn 1997 Btrieve Developer’s Journal server running NetWare Btrieve v6.10c? EXAMPLE: A Btrieve 6.x format data file has a key with flag value of 1281 (decimal), corre- Q & A A: Yes. The Btrieve Client Engine for Windows sponding to the attributes: Duplicates + NT/Windows 95 v6.15 can run on multiple Extended Type + Case-Insensitive. The corre- Windows NT or Windows 95 workstations and sponding correct INDEX.DDF definition should Q: What are the primary differences between share a file that happens to reside on a NetWare be 289. If INDEX.DDF was defined as 1281, the Btrieve developer kit for Windows 3.1 and server. The Btrieve v6.10c server engine would ODBC 2.0 and Scalable SQL 4 would assume for Windows 95/Windows NT, besides that one not be used, in this case. the key allowed duplicates, but was not Case is 16-bit and the other 32- bit, especially with Insensitive. This would result in the DDFs being regard to WBTR32.DLL? Scalable SQL inconsistent with the data files and errors (based on the operation being performed) would be A: There is no WBTR32.DLL. There is a Q: Explain the differences between the bit repre- returned by the new product line. WBTR32.EXE and a WBTRV32.DLL. The sentations for Btrieve indexes and Scalable SQL WBTR32.EXE is the 16-bit engine (32 bit equiv- key flags. Q: SQLScope statements that include CREATE alent is W32MKDE.EXE). The WBTRV32.DLL is TRIGGER and CREATE PROCEDURE within a the 32-bit interface (16-bit equivalent is WBTR- A: Many developers attempt to create Data BEGIN...END block are running correctly. CALL.DLL). Files containing table definitions for Attempting to run SQL statements with Delphi existing Btrieve data files. Also, many DDF cre- 2.0 with the ODBC driver that comes with Q: How does NTMKDE.EXE talk to BROUTER. ation utilities perform this same process. In the Scalable SQL 4.0 returns invalid syntax errors NLM (share files)? Does it require loading SPX past, this has caused no problems because a including status 501 and status 559. Why? at the NT server? Can an SAP agent at a consistency check of the DDFs against the data Windows NT server do that without having to files was never done. However, our newer prod- A: The ODBC 2.0 driver only supports 3.01 load SPX on the Windows NT server? ucts ODBC v2.0 and Scalable SQL v4.0 do a compatibility mode. The CREATE TRIGGER and consistency check to verify that the definition CREATE PROCEDURE SQL statements are only A: SPX needs to be installed on the NT server. defined in the DDFs correctly represents the supported in 4.x mode. Btrieve data file. The old process of generating The ODBC 2.01 driver supports both modes. Q: Are there any problems with Btrieve running DDFs from data files involved pulling the flag IPX over Ethernet using frame type 802.3? values from the data files (for Alternate Collating Q: What part of the Scalable SQL 4 installation Should the customer switch to 802.2? Sequences, Case-Insensitivity, etc.) and transfer- loads SQLScope? Would you find this utility in ring them to INDEX.DDF. Since these flag values the Windows directory? A: Pervasive Software has not seen any prob- are different for SQL and Btrieve and a consis- lems using either frame type. tency check is now being done this results in A: Stage the workstation Install images onto the errors occurring with the newer products listed server for 16-bit requesters and utilities, and Q: Can you run Btrieve 6.15 16-bit workstation above. The following is a list of flag values for then run the install off the server from the work- engine in a peer-to-peer mode under Novell Btrieve indexes and for the Xi$Flags field of station. Or, install the 16-bit requesters and NetWare 2.x? If not, what is the recommended INDEX.DDF. This is provided to assist develop- utilities off the CD-ROM itself onto the worksta- NetWare version? ers and DDF creation utility vendors with the tion. All of this is explained in the INSTALL.TXT process of creating accurate DDF definitions. included with the product. A: Yes, you can run Btrieve 6.15 16-bit worksta- Some method of accounting for the differences tion engine in a peer-to-peer mode under in flag values must be used during INDEX.DDF Q: I installed Btrieve 6.15 for Windows NT and Novell NetWare 2.x. creation under the new product line to prevent then Scalable SQL 4.0 for Windows NT. I then errors from occurring. Note these flags are KEY used the User Count Manager to install the Q: Are there certain Network Interface Cards (index) flags: license, but the license installed against Btrieve (NICs) that are incompatible with Btrieve? and not Scalable SQL. I now have a 20 user Some customers have said that they have expe- BTRIEVE Flag Values: Attribute Binary Hex Decimal Btrieve but 0 on Scalable SQL. How do I set rienced problems that disappeared when the the user count for Scalable SQL? NIC was changed. Duplicates 0000 0000 0001 01 1 Modifiable 0000 0000 0010 02 2 Binary 0000 0000 0100 04 4 A: There is a “user count migration” option to A: Btrieve has no known incompatibilities with Null Key (all) 0000 0000 1000 08 8 migrate your v6.15 Btrieve user count to NICs. However, if a card has any problems with Segmented 0000 0001 0000 10 16 Scalable SQL. You received a user-count key maintaining SPX sessions, or dealing with heavy Alt Col Seq (ACS) 0000 0010 0000 20 32 diskette with Scalable SQL for Windows NT I/O, Btrieve will expose the problem. Pervasive Descending 0000 0100 0000 40 64 CD. You should have been prompted to insert Software usually recommends contacting the Repeating Dup(v6.x) 0000 1000 0000 80 128 this diskette at the appropriate time during the card vendor to see if they have newer drivers. Supplemental (v5.x) 0000 1000 0000 80 128 Scalable SQL installation. However, if this did Extended Type 0001 0000 0000 100 256 not happen, you can use the User Count Ad- Q: How does a customer keep users from Null Key (any) 0010 0000 0000 200 512 ministrator to install the license key after the fact. accessing data files outside of an application *Case Insensitive 0100 0000 0000 400 1024 A licensing key is product specific; you cannot when using the Btrieve 6.15 server engine? SQL Flag Values: use a Scalable SQL key for Btrieve or vice versa. Attribute Binary Hex Decimal A: One way is to use owner names on the data Q: If Scalable SQL 4 is installed and running, files. In this way, the application must pass an Duplicates 0000 0000 0001 01 1 Modifiable 0000 0000 0010 02 2 but I need to use 3.01 compatibility mode, does owner name during the Open call. If users are Alt Col Seq (ACS) 0000 0000 0100 04 4 this require a reinstall? using ODBC, for example, to get to the data, Nulls Not Indexed 0000 0000 1000 08 8 they will not be able to open the file(s) without Segmented 000 0001 0000 10 16 A: No; 3.01 vs. 4.0 compatibility mode is speci- knowing the owner name(s). Setting and *Case Insensitive 0000 0010 0000 20 32 fied per session (i.e. per application) at the time removing owner names is a function of Btrieve. Descending 0000 0100 0000 40 64 the application establishes the session with Owner names can be specified using two access Named Index 0000 1000 0000 80 128 Scalable SQL. In other words, the application modes: 1) read-only open allowed without Named Index 0000 1000 0000 80 128 specifies which mode to use during the login to owner name specified; owner name required to Extended Type 0001 0000 0000 100 256 a database. This feature was designed in such a modify the file, or 2) open (read or write) NOT USED 0010 0000 0000 200 512 way that existing Scalable SQL 3.01 applica- requires owner name. NOT USED 0100 0000 0000 400 1024 tions (developed according to the 3.01 specifi- * Only used when defining Case-Insensitive indexes in 6.x cations) automatically login using 3.x mode Q: Can a user port the Btrieve Client Engine for format Btrieve data files. when run against the Scalable SQL 4 engine. Windows NT/Windows 95 v6.15 to a NetWare Btrieve Developer’s Journal Autumn 1997 15 Q: What does the message “Error reading keyword in the CREATE TABLE statement. In unmodified with Microsoft Visual Basic 5. User Count File UCMGR.KEY - O/S error = general, it’s best to use a pagesize of 4096, 0” mean? since this generally corresponds to a disk Q: What does the Microsoft Access error block, or is an even divisor into the disk 7778 mean? A: This message is referring to the platform block size. specific User Count Manager system file. In There are 2 main consequences of A: This Microsoft error means, “Driver or particular, the file NTUCMGR.SYS and choosing a pagesize of 4096. The first is disk server in keyword connect string is blank”. NWUCMGR.SYS are used for Windows NT usage. A page in a Btrieve file will always Use ODBC Administrator 3, add datasources and NetWare, respectively. The actual key contain “whole” records. If your physical using either System or User DSN. The user file, UCMGR.KEY, is used when adding a record size is, for example, 1500 bytes, only must choose the machine tab to see the data- user count to a Scalable SQL or Btrieve two records will fit on a page, and about sources created using the System and User installation. This error message indicates that 1000 bytes of each page will be unused. In DSN. the User Count Manager utility detects a bad this case, a page size of 2048 would be a KEY file. Contact Pervasive Software's sup- better “fit,” producing less wasted space. If Q: A customer has a 20-user Btrieve v6.15 port department and request a new key. most of your data records are relatively small, with ODBC 11.0. He can not install the Please be prepared to provide the Scalable this is not normally an important factor. ODBC due to ODBC incompatibilities. He SQL serial number, its user-count, the email Also, there is an alternative, which is to use a wants to get the version 2 upgrade of ODBC. address where the new key should be sent, 4096 page size, and specify that you want to But is it possible for him to install it without and a photocopy of the Scalable SQL key use data compression when the file is creat- having version 1 installed? If not, what are diskette with the serial number. ed. This would avoid the large wasted space his options? problem. The performance overhead of data Q: A problem may occur when accessing a compression is minimal. A: It is a Microsoft problem with ODBC local file on a Windows NT 4.0 workstation The other downside of using the largest administrator 3 not supporting ODBC v1.0.x. using the Btrieve/Scalable SQL Server page size is the level of concurrency when There is a document ODBCWRKA.DOC on engines. The Scalable SQL 32-bit setup utili- using transactions. Performing writes (inserts, the FTP site (ftp://ftp.pervasive-sw.com/sup- ty was used to set TargetEngine=Server for the updates, deletes) from within a transaction port/refshelf) that tells the user how to work following settings: Scalable SQL Requester, causes the Microkernel to lock the pages of around this. ■ MicroKernel Requester and MicroKernel the data file that are being modified. If multi- Router. However this resulted in a status 95 ple users are performing transactional “Session No Longer Valid”. The registry updates on different records and/or keys that TECH TIPS under [Btrieve Technologies] showed happen to reside on the same page, one user TargetEngine set to Workstation; this indicates will be locked out until the other finishes. that the 32-bit setup must be looking at Your application can re-try the operation until • Customers having problems with ODBC [Pervasive] while the requesters are looking the lock is released. Since a large page size 2.0 and Great Plains (Dynamics) should be at [Btrieve Technologies]. Can I remove the allows for more records or keys to reside on referred to [email protected] (Dynamic Tools [Btrieve Technologies] key and rely on the a single page, it increases the chances that a Support). Pervasive Software will be sending [Pervasive] key? transactional conflict may occur, even when fixes to Dynamic Tools Software Quality users are operating on different records. Assurance, and Great Plains will decide how A: Leave the Btrieve Technologies key entry, to tie them into their application. Since their and make sure it has the proper target engine Q: Does Pervsasive Software have anything application actually generates DDFs and they setting. This is necessary if you happen to that will transfer Scalable SQL v3.01 views have multi-platform users, Pervasive Software have Btrieve v6.15 server engine installed on back into the original scripts. cannot send fixes to the customers; customers the server as well as Scalable SQL 4.0 for NT. should consult with Dynamic Tools Support In this situation, if the Btrieve Technologies A: The following is an excerpt from concerning all issues with the application key entry is removed, the entry will reappear VCONV.TXT in the SSQL40\BIN directory: and ODBC until further notice. Some issues with all default settings each time you start seen are Pervasive status 238, MS Access run- the Btrieve for Windows NT v6.15 service. VTEXT time 3155, MS Access 7716 error, and Pervasive status 353. Q: What considerations should be taken into VTEXT converts a stored view definition to a account when optimizing data files for text string and displays the string. Optionally, • If you encounter errors with ODBC 2.0 and Scalable SQL as compared to Btrieve? you can store the string in a file. You can dis- Microsoft Access, be sure that all database play only one view at a time. VTEXT works tables have a unique index. SQL ANSI stan- A: Scalable SQL stores data in Btrieve data only with pre-v4.0 dards require a unique key on every table. files. Btrieve files are constructed of “pages” Scalable SQL databases. of bytes. Each page contains a particular • If your joins are not returning the recordset type of information such as records, indexes, The syntax for VTEXT is as follows: as expected, be sure that all database tables control information, etc. The size of a page have a unique index. The SQL ANSI standard requires a unique index on every table. is any multiple of 512 bytes ranging from 512 VTEXT [options] to 4096. The Microkernel always interacts In oder to create a datasource with ODBC with the operating system by requesting or is the name of a view in a Scalable SQL • writing a page at a time. database. v2.0 using Database Names, the following In general, you’ll see better performance DLLs need to be in the path: if you create your data files with a page size Q: Does Scalable SQL 4 support Microsoft W32BTICM.DLL 42,496 2/13/97 that is an even divisor of 4096, which Visual Basic 5? W32BTINT.DLL 347,648 3/13/97 includes 512, 1024, 2048, and 4096. By W32SSFMT.DLL 291,840 2/10/97 default, all files (tables) created via Scalable A: The Scalable SQL 4 sample code supplied WBTRV32.DLL 64,000 6/27/97 SQL are created with a page size of 4096. in the developer kits was compiled with WDBNM32.DLL 198,144 2/10/97 This can be manually set with a PAGESIZE Microsoft Visual Basic 4 but should work WODBC32.DLL 88,576 1/25/97 ■

16 Autumn 1997 Btrieve Developer’s Journal THE CHANNEL CORNER

Pervasive Announces Additional Training Resources exas Highway 8834 Capital of T Austin, TX 7879 Bill Bach, Certified Instructor for 512.794.1719 Pervasive Software and his company, 512.794.1778 fax .com http://www.pervasive-sw Goldstar Software Inc. now provides cus- tomized training for Btrieve and Scalable SQL, along with installation and support TO YOUR SUCCESS services, to companies across the United WE ARE COMMITTED y of you regarding our States. tunity to speak with man vations that will assist I have had the oppor ery insightful obser For the past few months Bill has trav- ew months, s. I would like to Over the past f You have provided us with v hannel partner ections. ou to provide us eled to many of our different scheduled y and product dir en stronger alliance with our c age y compan ostering an ev ue to encour training locations to provide a “hands on ervasive team in f or the channel and contin the P rent and future plans f pplica- e some of our cur ve been building a approach” training. We have kept our shar s. Many of you ha ou have oing feedback. hannel partner ing that time y classroom environments small and Bill has with ong tionships with our c umber of years. Dur - e value our rela hnology for a n oduct line and a com W e’s database tec luding an expanded pr ue to been able to offer some customization for vasive Softwar hanges inc hannel. We contin tions on Per ough a number of c y ve Software go thr ed is our commitment to the c hnology that is ideall the developers attending. seen Pervasi t has not chang ded database tec - e. One thing tha s with embed ormance, mainte Pervasive Software plans to roll out pany name chang cial developer A. VARs and commer our applications on our high-perf t have no DB oviding uilding y ed businesses tha e training calendars via the web at least focus on pr ket end users. By b king to improv or middle mar ve the needs of small to mid-siz ually wor suited f you are able to ser . In addition to contin three months out so developers can plan ee databases, hange is in order ovider to the end nance-fr t more c t you. As a total solution pr y accordingly. If you want more information Your feedback tells us tha forts to suppor wer any questions the e stepping up our ef tabase needs and ans umber of pro- oduct line, we ar our customer’s da ou can expect a n on upcoming events, or have a need for our pr ou to address y Y e want to equip y additional training, call 1 800 Btrieve or e- user, w ervasive database component of thet. solution. egarding the P may have r t are to designed to do just tha mail [email protected]. ■ ear tha or: grams in the coming y s and resellers Here are a few of the highlights to lookor ourf developer tion f s to impact their bottom line Major emphasis on educa orts with partner ¥ keting eff e ¥ Expanded joint mar or global exposur Pervasive Appoints Advisory Council ectory on WWW f ¥ Solution Dir tion via web eal time informa ¥ Access to r Pervasive Software appointed 20 of its oduct promotions ¥ Ongoing pr t Groups partners to its first-ever Advisory Council. inger tips ¥ Enhancements to our Supporces at your f - In its first meeting, held at the end of Additional Training Resour k. We welcome contin ¥ vents om your feedbac tner- Published calendar of e ect result fr September, the council meeting’s theme ¥ veloped as a dir vasive- ograms have been de ou need to be successful.channels@per in this par These pr hat additional tools y t http://www - was “Partnerships built on a shared age you to tell us w with any sugges y sending us e-mail a vasive-sw.com vision.” With the goal of soliciting feed- ued input and encour ou suggestions with us b y at dvalenti@per You can share y ectl ship. elcome to contact me dir om you. back from its partners, the council dis- .com. You are also w ard to hearing fr sw ns. I look forw cussed the future direction of the com- issues or concer tions, pany, including how to best meet its Sincerely, customers needs, how to meet unique demands, product round-ups, strategic opportunities and expanded opportuni- ■ Valentino ties for shared growth. David keting Director of Channel Mar are Inc. Pervasive Softw ties, sales and marketing tools, and a Pervasive’s OEM Partners serve this market quarterly newsletter that keeps resellers up- Pervasive Introduces Strategic Partner by integrating Pervasive database products to-date on the latest products, tech tips and Reseller Program (SPRP) into packaged applications for delivery competitive analysis. through the value-added reseller channel. “Pervasive’s extensive training, support Pervasive Software has extended its In this model, resellers form the critical and focus on the middle-market coupled worldwide channel to include a Strategic link between OEM’s and the end user, pro- with database engines that are both eco- Partner Reseller Program (SPRP). Through viding need analysis, product specification, nomical and easy to own make them our the SPRP, Pervasive will offer a broad range installation and training. Pervasive’s SPRP database vendor of choice,” said Jim of support services directly to resellers of provides resellers with a comprehensive Stritzinger, president of ClearView Software, Original Equipment Manufacturer (OEM) range of support services designed to help a leading software consulting firm. products based on Pervasive database them effectively meet the unique demands “Middle market end users depend on engines. of the middle market segment. package integrators, consultants and This move will dramatically strengthen Members of the SPRP are assigned a resellers for their database solutions. By the OEM’s ability to deliver turnkey appli- dedicated account manager who knows strongly supporting this network we stream- cations configured for the middle market, Pervasive database engines and the line sales and installation cycles, saving which is defined as small to medium-sized reseller’s application. SPRP participants both the reseller and the end-user time and businesses that require a packaged applica- can also take advantage of free, regularly money,” said David Valentino, director of tion needing little or no IS support. scheduled nationwide training opportuni- channel programs at Pervasive. ■ Btrieve Developer’s Journal Autumn 1997 17 Clarion For Windows RAD, RAM, & RAE, How True?

By Ayodele Dahunsi [email protected]

As the search for a simpler and more efficient development plat- Therefore, the only difference in appearance after deploying your form widens, new terms, standards and methodologies are emerging. application to another environment, say Windows 3.11 comes from the They include Rapid Application Development (RAD), Rapid operating system itself. Running your application on a Windows 3.11 Application Maintenance (RAM), Rapid Application Enhancement machine behaves the same way and has the same look and feel. Seems (RAE), or Rapid Business Application Development (RBAD) pro- TopSpeed upgraded your Windows 3.11 to Windows 95! nounced Ree-bad-the list goes on and on. But, TopSpeed Corporation, http://www.topspeed.com, the developers of Clarion for Windows clas- sifies Clarion as not just a RBAD tool, but also as a real RAM and RAE tool that ensures code production stays “Rapid” for the lifetime of the application. In a transatlantic telephone interview Richard Taylor, TopSpeed’s director of technical communication, said: “Any programmer that is not using Clarion to develop business applications must really be working very hard!” How true is this statement? I con- verted to Clarion from Clipper about a year ago, and I can now make an assessment based on my own experience. The transition from Clipper did not come easy! I needed to “modify” the part of my brain that has been “xbase-driven” for so Windows 95 application running under Windows 95 many years to adjust to being “clarion-driven” and “event-enabled.” There is always an initial period where you keep on asking question Language Structure on topics that are explained in the manual. Nevertheless, as soon as The Clarion for Windows language structure is in a class of its you reach that point, having adjusted to Clarion’s style of develop- own-in coding is simple. Nevertheless, the Clarion library has been ment, you can operate on your with occasional requirements for some designed specifically to work with the Clarion Structure, which has its specific type of coding. One thing is certain; the language is easy to own optimised way of addressing the Windows user interface without understand. directly using the Windows API. Therefore you don’t need Microsoft Having said that, however, you must know that the language is Foundation Classes (MFC) for development. It has a data-centric business-oriented. You can make extensive use of APIs to make a implementation tending more towards ODBMS. front-end to different kinds of non-business systems. A Clarioneer, as Similar to other Windows development tools like PowerBuilder, Clarion Developers call themselves, recently posted a message to the Visual Basic, or Delphi, Clarion is able to reuse code already written Newsgroup saying he has been able to develop a Windows application in the form of custom controls (.OCX, .VBX), or embedded objects which runs pumps, opens valves, measures speed, and interfaces digi- (OLE). However, unlike these other tools, Clarion as Template-driven tal control, etc using Clarion. Well, this seems a far shot from what I Visual 4GL generates major portions of an application automatically. will want to use Clarion for! But it shows that when you are designing For example, in a SAVE button control, Clarion does not only generate business systems, you will be able to fully appreciate the strength of the code for the control but also containers, and the underlying Clarion Clarion. code that actually provides the functionality for the control. Develop- ment time is reduced drastically and code maintenance, easy. Clarion’s User Interface Templates are two-way interactive tools in that they continually main- TopSpeed did a good job in designing Clarion’s controls. It tain the code they generate, not one-way wizards that simply generate duplicates the look and feel of Windows 95 controls across all code for the programmer to maintain. Templates, unlike wizards can be Windows platforms (from Windows 3.11 to Windows NT) when used maintained. as either a 16- or 32-bit applications. Controls such as property sheets Among the many features of Clarion’s compiler are automatic (tabs), tool tips (balloon helps), not existing in Windows 3.1x have type conversions while being very smart, probes expressions for mean- been built into the Clarion structure. You can develop a Windows 95 ings, thereafter, logical conversions are supplied. Therefore, by select- application as 16-bit or 32-bit with the same version of Clarion with- ing appropriate data types for intermediate values, data types are easily out caring to know what your end-users operating system will be. converted during compilation without loosing information. Notice the toolbars, tabs which are a feature of Windows 95 appearing The ACCEPT statement is a structure defining the boundaries of in the Windows 3.11 workstation displayed below. an event processing loop. In the Clarion for Windows run-time library, structure is objects, which have properties. However, the compiler together with this run-time library hides the direction of the procedure calls used to process window events. Therefore in opening a window, a run-time window processor is generated above the ACCEPT loop with the loop itself generated as an embedded accept procedure. With this, the window processor is able to create the required objects, which specifies a shared event processing procedure for every event produced by every object. This event processor handles “housekeeping” events such as redraws and this calls the embedded accept procedure to deal with other events. Thereafter, when the window closes, the window processor returns control to the statement following the ACCEPT loop. Windows 95 application running unmodified under Windows 3.11 18 Autumn 1997 Btrieve Developer’s Journal So, you can simply open a window, get into an ACCEPT loop which your own custom code within the generated code. These points are in turn allows you to cycle for every event the application needs to see. defined in each template. The templates you need to develop most Processing a simple dialog is as easy as this: applications are supplied with the Clarion, but the template language is somewhat more difficult to grasp. Even though one can modify the OPEN(Window) !Open the window source of the template for customisation, I have been able to develop ACCEPT ! Enable the window applications for over a year without having to delve deep into template CASE FIELD() !Which field needs attention? programming. If you are smart, you can take real advantage of embed points. There is even a Source Template that generates no code other OF ?OK ! ‘OK' needs attention than your custom code-allowing you to write completely hand-coded CASE EVENT() ! Which event has occurred? procedures and functions if you want to. A programmer can easily OF EVENT:Accepted ! 'OK' is pressed down pick up code maintenance from where one has stopped. The applica- : ! Process the OK button tion generator maintains a consistent geometric representation of pro- cedures, programs, and routines. Even the procedures, libraries, icons, CLOSE(Window) ! Close the window and all external files used in a compile can be seen in a geometric END ! End CASE EVENT() model. OF ?Cancel ! 'Cancel' needs attention CASE EVENT() ! Which event has occurred? OOPs Clarion! OF EVENT:Accepted ! 'Cancel' is pressed down Clarion for Windows 4 (CW4), still in Beta 2 is fully object-ori- : ! Process 'Cancel' button ented supporting Object Oriented constructs (encapsulation, inheri- CLOSE(Window) ! Close the window tance, polymorphism). It has almost the same implementation of the END ! End CASE EVENT() look and feel of C++. Because of its high-level data structures you can ELSE ! Must be a non-field event be working at the level of the language, or the API, whichever you choose by deciding to work at a very high level, or go lower. The CASE EVENT() ! Which event has occurred? object framework of the OOP implementation in CW4 is the Clarion OF EVENT:CloseWindow ! The window will be closed Application Builder Classes (ABC Library). The ABC Library which : ! Process window close down provides all the benefits of class libraries in general, has been modeled END ! End CASE EVENT() for database application functionality like navigating, updating, and END ! End CASE FIELD() reporting unlike any other development tool where the design is usual- ly around the user interface — window classes, message classes, in sim- END !End ACCEPT RETURN !Return to the caller See Clarion, page 20

Since structures are treated as objects in Clarion’s runtime library, the properties of these objects can be changed anytime. However, “curly brackets” are used for changing properties of objects rather than use the standard object oriented notation of object.property. For exam- ple, changing the icon on a control button named MyButton: Authorized Training Center

?MyButton{PROP:Icon} = 'C:\Windows\ MORICONS.DLL[10]' The only Europe Wise Authorized Services !Displays the 10th icon in MORICONS.DLL Provider for Btrieve & Scalable SQL:

Sending a report to LPT2 is as simple as this: ¥ Training & Education ¥ Installation & Consulting PRINTER{PROPPRINT:Port} = 'LPT2:' ¥ Audit & Optimization ¥ Customized Development How Well Can You Maintain Your “RAM”? The strength of Clarion and the effectiveness of your overall sys- With a full range of System Tools: tem lie in a well-designed Data Dictionary. Once you design the Data ¥ BTRCONT (NT & NetWare) allowing ON LINE Dictionary very well, you have achieved almost 80 percent of your backup systems to backup Btrieve/SQL databases development since the rules you established there would always be although tables are open (Scheduled or within a applied as you start creating your browses and forms. When you popu- batch) late controls also, you have a consistent user interface that can be ¥ SchedCom, Tco, Applet allowing NetWare maintained at a single point to cut across the entire system. Commands from any LOCAL or REMOTE Applications in Clarion are maintained in design repositories. workstation to be expected interactively or in These are an application generator, and the data dictionary. The data scheduled batch mode dictionary contains information on how your data is stored, accessed, displayed, and processed. This is already like an almost complete data processing cycle, and this is where a lot of time is spent in develop- Visit our Web: ment. Failure to spend quality time will result in a poorly designed http://ourworld.compuserve.com/homepages/netwell system. This is a common pitfall for new users who are itching to get a E-Mail: [email protected] system out fast. 34, rue de Verdun Clarion is also able to preserve your custom code so long as it is 93160 NOISY LE GRANDE Phone: +33-1-43-05-91-91 placed in “embed points” within your Clarion application. The “embed FRANCE Fax: +33-1-45-92-07-82 point” represents a specific logical position where you may embed

Btrieve Developer’s Journal Autumn 1997 19 Clarion ...continued from page 19 ple terms, general purpose programming classes! This would put to Btrieve Support rest Jim Kyle’s quest for The Object Model better known as Object In Doug Reilly’s Winter 1996 article, A Request For Help, he Database Management Systems (ODBMS) as specified in the stated that Delphi as a perfect example of the less-than-perfect envi- Winter 1996 edition of BDJ. Below is a representation of what ronment for developing Btrieve applications. The reverse is the case Clarion’s Class hierarchy looks like: while using Clarion. In all libraries, development tools I have used, Clarion’s Btrieve support still stands out as one of the best and most efficient. TopSpeed developers did a good job in the interface of ErrorClass FieldPairs Btrieve with their language structure. When an error occurs, exact Btrieve error codes are always returned. Of course, initial complaints from the comp.lang.clarion newsgroup can be expected just as from any new user of Btrieve no matter the development platform. I real- ized that most Clarion programmers with very big sites are using Btrieve. Prior to writing this article, I sent out a questionnaire to comp.lang.clarion to sample opinion about Btrieve. The statistics I got showed that 50 percent of the respondents FileManager Relation Manager considered the Btrieve Engine to be good, 36 percent were currently using it, and 20 percent considered it problematic/complex. Unfortunately, only 12 percent were using Scalable SQL and DDF Builder, and 23 percent didn’t know anything about Btrieve! These last two results actually confirmed my fears on the lack of publicity of all these Btrieve-related products among the Clarion family. Even though there is no direct support for DDF files in Clarion View Manager Standard version or Professional version, there is planned support in the Enterprises edition due for release very soon. However, I have been able to provide a simple workaround for my Btrieve files since I use Crystal Reports and DDF Builder. I import my files into Clarion’s data dictionary via my Btrieve ODBC.

Other Files/SQL Interfaces Browse Other supported file systems include TopSpeed data engine, Clarion data engine, dBase3, dBase4, Clipper, FoxPro, and ODBC. Clarion also provides native drivers for a couple of Client-Server databases like Oracle, Informix, and even Access to AS/400. In order to access AS/400 files, you use the same Clarion database. The FieldPairs Class refers to the copy of the row or records in Even though SQL is used to retrieve data from an AS/400 database, memory (i.e. the record buffers), that contain your data. This data the user is not compelled to use only the SQL tables stored on the structure is therefore the main object from which others are derived. AS/400 because the driver enables you to access data directly. The This makes the ABC Library datacentric. TopSpeed claims no other Oracle driver provides transparent access via SCQ*Net to the compiler in the market today has these features! The ABC Oracle database. Templates can automatically generate codes that uses objects The beauty about the interface to all these database drivers is defined by the ABC Library. However, the ABC Templates are not that you can have a mix of them in an application and your applica- a requirement to use the Application Builder Classes. In all you tion produces the code to make them behave transparently to the have a RAD tool providing typical reusability and maintenance user! Benefits. As an example, even though the ABC Templates, Library, and Internet In a Box? the Clarion’s visual source code formatters usually generate English language user interfaces by default, it is also easy to produce non- TopSpeed’s Clarion for Windows (CWIC) English user interfaces. This can be achieved by using the Trans- allows you to create Internet/intranet applications as easily as you latorClass. The TranslatorClass makes it possible for you to deploy create your Windows programs. This means the same compiled exe- a single application that the end-user can customize, regardless of cutable, containing both the web code as well as the Windows 32- their language preference. That implies you can display several dif- bit code can run as either a Windows executable or a Web server ferent user interface languages based on end-user configuration or application! Creating new applications is therefore a snap using the some other criteria defined at runtime, such as INI file or system Application Wizard. With this, you can just easily “Web-Enable” file configurations. The Language customization operates on all your existing Clarion applications by adding an extension template user interface elements like window controls, window titlebars, and and recompiling. even tooltips. Also list box headers, and static report controls are The beauty of CWIC is that the server application is the appli- affected. Among other features expected in the Clarion 4 are, sup- cation that talks to the data files, so making a Btrieve-driven web port for the Raised/Flat button look made popular by Internet application is no different from developing a windows application Explorer and Office 97, Wallpaper (tiled bitmaps) for windows, which uses the Btrieve driver. Even though it is still in its Beta support for .GIFs (even animated and/or transparent .GIFs) on but- stage, some companies are already implementing this in their web tons, support for Long File Names within 32-bit applications, using sites. I connected to ONTOP System’s site http://www.ontop.com/ the Windows 95 style Open/Save file dialogs. hot/hot1.html where they have used CWIC and the Btrieve as their

20 Autumn 1997 Btrieve Developer’s Journal Clarion ...continued from page 20 POV ...continued from page 11 backend web serving database engine. 2. Convene a group to discuss the issues our customers face Other supported file systems (TopSpeed, Clarion, xBase, and come up with ways to make things easier for everyone. ODBC, etc.) can also be used with your applications. You can also The electronics giants (except Sony) agreed on VHS right? use the available add-on drivers to access Oracle, AS/400, or MS What exactly is the standard format for a string field? SQL Server databases. The CWIC is still in its Beta, and would Space padded? If Pervasive does not have a standard then have been released by the time you will be reading this article. You let’s create one. This group can make recommendations to don’t only reuse some of your code, you reuse the entire applica- Pervasive on priorities, issues, etc. (I guess I’ll have to fight tion! with Scott Smith to be President) This group can work with Pervasive to keep focus on the needs of our ourselves and Documentation & Support our customers. For example, for get about support for nest- ed transactions, I would like one Btrieve API call that emp- The Clarion for Windows Professional Edition comes bundled ties a table. It is our duty to feed back this information to with five manuals, which are over 2,700 pages of documentation. Pervasive. The on-line Help included with the system is quite extensive too, containing context-sensitive Help for every dialog in the develop- 3. Keep evangelizing Btrieve! We all know it is a great prod- ment environment including those interactively generated by the uct or we would not have committed our careers to it. Templates. The complete Clarion language and Template language Magazines like Btrieve Developer’s Journal, the Internet, references are also available on-line. TopSpeed did quite a good job CompuServe, what is really happening out there, and ways in overall documentation. However, I must say that there isn’t much to improve what and other forums should be used to the documentation on the Btrieve driver. This probably is the cause for fullest to promote Pervasive products and related utilities. lack of interest in the driver. Well, if you are reading this article you must be getting technical support and documentation from another I hope my point of view (and the views of my customers) has source, BDJ. And with BDJ, what else do you need? I do not think not been too sharp, but I think it is of great service to us all to hear I have had any serious need to get technical support on Btrieve about we do. If our products were perfect we would never have since I get all I want through BDJ! upgrades. Clarion has an active newsgroup: comp.lang.clarion and you need to see how dedicated and committed people are in offering solutions to problems. One thing is certain, it is very difficult to Peter Blair is the developer of Titan Btrieve, a Btrieve interface woo a Clarion programmer in switching from Clarion to something for Borland Development Tools, and the President of Reggatta else. He will vehemently resist you! Systems, Inc. In summary, Clarion is good, fast and easy for development, BUT ... there is a learning process you must encounter. Clarion. B TRIEVE EXPLORER™ SMARTER, SIMPLER, FASTER... BETTER! FREE DOWNLOAD!

Multiple Data Windows For Easy Comparison Familiar Explorer-Like Interface

Essential Functionality Only a Right-Click EXPLORE YOUR DATA IN A LIGHTNING FAST VIEWER DESIGNED SPECIFICALLY FOR BTRIEVE... Away ...by Btrieve users... for Btrieve users! SMARTER Automatically preserves useful user settings such as field layout and sort. Allows simultaneous viewing of any number of data windows. SIMPLER One step data viewing—no need to link or embed tables—just double-click! ...by Btrieve users... for users! FASTER Obtains maximum performance via 32-bit, multithreaded processing and direct MicroKernel access. Download your free evaluation copy from www.mik-sw.com 972-650-9226 MIK & ASSOCIATES SOFTWARE 972-650-9444 (Fax) “Real Programmers. Real Solutions” but never actually used it, or actually talked to the folks who used it. For instance, imagine you are a Cobol programmer in the late 80’s, and you have a record that has a two-segment key. Both segments are numeric, and the segments are contiguous in the correct order. For instance, PO number 22456, line number three might be physically in the file as 022456003, assuming six digit PO number and three digit line number. It is likely that in creating the file you will create a sin- gle key segment the length of both fields rather than two separate seg- ments. In addition to the convenience of creating a single segment, you might do this to ensure that you do not exceed the Btrieve 5.x limit of 24 key segments. Microsoft’s programmers working on Access 1.x and the Btrieve ISAM driver clearly had no idea that this was common practice. It was not as if they had to search high and low for examples of this sort Inside the Microsoft SQL Server of fudging about key segment layout. The practice mentioned in the previous paragraph was common enough that some reasonably popular Developer’s Resource Kit accounting packages would construct files in exactly this way. Unfor- tunately for Microsoft and potential users of Access’ Btrieve support, By Doug Reilly the early Microsoft ISAM for Btrieve files was a “segment Nazi,” insisting that you create your files exactly as you were logically inter- [email protected] preting them. This made for some rough sledding for the Microsoft support folks, and probably further soured Microsoft on the then- Pervasive, I have good news and bad news: The good news is, Novell-owned Btrieve file format. Microsoft thinks you have a large enough share of the embedded data- base market that you are significant. Of course, the bad news is that The Microsoft Migration Plan Microsoft thinks you have a large enough share of the embedded data- base market that you are significant. Microsoft does not have a habit It is with this as background that I took a look at the Microsoft of going after market segments and not having some impact, eventual- white paper. I was actually impressed with most features of the white ly. In the case of, for instance, Network Operating Systems, it took a paper, and though there are some statements I question (more about decade or so before Windows NT finally gave Microsoft credibility. those later), the general directions presented are interesting reading, But when you have a few billion dollars to play with, time is on your with implications beyond simply SQL Server. side. Of the two major models used to access databases, Relational and Not long ago I was poking around Microsoft’s web page came Navigational are the mode common. Relational access is normally across the SQL Server Developer’s Resource Kit at URL through Structured Query Language (SQL). SQL access commonly http://www.microsoft.com/sql/reskit.htm. Along with some of the deals with result sets rather than individual rows or records. Navi- expected information (about converting Oracle applications to SQL gational access is most often associated with a proprietary API (like Server, creating efficient SQL Server applications) I found one white the BTRV() function call or similar calls used by systems such as paper that surprised me. The white paper is entitled “Migrating C_ISAM). Navigational access often returns a single record, and vir- Btrieve Applications to Microsoft SQL Server” by Matt Domo. tually always deals with only a single physical file or table at a time. Seeing a paper describing converting navigational access to relational What does Microsoft know about Btrieve? access was interesting, seeing as how relational access systems often use navigational primitives to get at the data. For instance, I believe This was more than a bit of a surprise to me, since Pervasive, in that XQL, Scalable SQL’s predecessor, was implemented by calling spite of recent advertising campaigns, keeps a relatively low profile, the Btrieve engine. and is not often mentioned as a competitor of Microsoft SQL Server. The conversion process proposed in the white paper consisted of In fact, when I attended a briefing on the introduction of Scalable SQL three steps: 4.0, the Pervasive folks indicated that the big boys (an allusion to Microsoft, I expected at the time) were after their market share. At the ¥ Create a wrapper DLL. time, I wrote it off to marketing bravado and wishing to drum up sup- ¥ Convert the application to ODBC and SQL. port for the little guy, but now I am not so sure. ¥ Tune to properly use server resources. I downloaded the file and extracted the documentation and source files, not expecting too much. After all, I was around when Microsoft This is a reasonable strategy, mirroring the one proposed to create released Access 1.x, designed to be the universal database access tool, a TCP/IP Btrieve Requester. (See Inside Btrieve: A Request for Help with “native” support for many common data types, including Btrieve. in the Winter 1997 issue of BDJ). The first step, creating the DLL Forgetting for a moment the inclusion, and then exclusion of the wrapper, is a simplistic affair, wrapping only three functions of the Btrieve DLL, support for Btrieve in Access 1.x was remarkable only eight functions exported that might actually be called (see listing 1). for it’s naivete. The three supported (sort of) are: BTRCALLID(), BTRCALL() and Imagine you have a visitor from another country, and that visitor WBRQSHELLINIT(). In fact, BTRCALLID() is not really supported, has a good understanding of the English language from reading text with calls to B_VERSION and B_STOP quietly ignored, and other books, but has no knowledge of idiomatic English, that is, English as it function calls generate a diagnostic on screen. These three were is actually spoken. That person would be very confused by some of selected as a result of checking on imports to BTRVAPP.EXE, and the phrases we use. For instance, if we indicate a friend has “bought example Btrieve application being ported for the example. the farm,” someone doing a strict translation of the English would While more complete options are discussed, the solution selected probably wish to congratulate the purchaser of the farm, whereas we for the example presented in the white paper is a minimalist approach would wish to console the next of kin. to wrapping Btrieve operations. Rather than create a wrapper that Microsoft Access’ early support for Btrieve was very much like transparently takes any arbitrary Btrieve file and operations and trans- that. It was as if the Microsoft programmers read the Btrieve manuals lates that to a SQL Server call, the wrapper is crafted to operate on 22 Autumn 1997 Btrieve Developer’s Journal two files, derived from the well known Pubs sample that is delivered This statement would result in a single record being returned, with SQL Server. Of course, it is probably not reasonable to access since TITLE_ID is known to be a unique key. Depending upon the arbitrary files without at least a Data Dictionary File being used. This size of the actual database, this might be more or less efficient, since is because the record manager model of Btrieve does not mesh easily creating and closing connections are expensive operations in terms of with the table/field orientation of SQL Server, or even Scalable SQL, processing time on the server. for that matter. There are other details involved in mimicking the Btrieve naviga- One of the things that you need to do to wrap Btrieve calls is to tional API with an SQL based, relational model. When a request to somehow tie the position block to a file, so that you can establish a end a transaction is received, the connection must be re-opened, since session, with positioning information maintained between calls. In the in Transact SQL (the version of SQL in SQL Server), the cursor is Btrieve Requester column mentioned above, I used the position block closed when a transaction is committed. as a simple string that contained an ASCII representation of the handle Another problem encountered is handling errors. The semantics number that the server assigned during a call to B_OPEN. The wrap- of a Btrieve call includes the return code, indicating success or failure. per DLL presented in the Microsoft White Paper takes a simpler The wrapper DLL covered in the white paper does a good job at map- approach, storing the actual file name in the position block, allowing ping end of file and record not found errors, but in many other cases, future operations to use this to know what “file” is being accessed. simply returns a code for an unrecoverable error. One problem with this in a normal Btrieve application is that some- times more than a single instance of a file is opened by a single appli- OK, it’s a cute idea, but will it work? cation. Using this strategy (using the file name as the sole value in the position block) you are limited to one open handle to the file. I have not actually tested the code in the white paper, because Just as significant as the previous limitations in the example pre- unfortunately, it is really a very simple demonstration project. In prac- sented is the fact that in some cases, the application simply plows tice, I expect that the use of unconstrained SELECT statements would through the entire data set to find a particular record. Assume the be it’s undoing. The white paper also describes a “next step” proce- record layout in listing 2, taken from the Pubs sample records in the dure that uses stored procedures to efficiently handle calls for a single white paper. A common thing to do might be to search for the title TITLE_ID. Stored Procedures offer an advantage beyond the ability with a particular title ID. For this example, lets assume it is title ID to properly constrain the select statement. Since the procedure is “0000012”. The example wrapper DLL uses an SQL connection already set up on the server, it is pre-processed and likely to run more established with a Select statement: quickly. Scalable SQL 4.x also has support for stored procedures. Of course, this also is only useful for accessing files known at design SELECT TITLE_ID, time, not any arbitrary SQL based table at run-time. TITLE, More important than if it would work, why would anyone want it TYPE, to work? Other than changing databases (Microsoft’s hope) there are PUB_ID, reasons why this sort of Navigational to Relational mapping might be PRICE, ADVANCE, See Inside, page 27 ROYALTY, YTD_SALES, PUB_NAME, CITY, STATE, COUNTRY

FROM TITLEPUBLISHER KnowWare Software-Systems GmbH For a GET_EQUAL statement, the wrapper DLL simply reads ¥ Technical Support ¥ Inhouse-Service ¥ Sales through the records to fine the Title ID requested. The key number is not used to actually ensure that records that are part of a ¥ Training ¥ Programming ¥ Tools GET_EQUAL/GET_NEXT pair of operations are actually returned in the correct key order. Key number is used only to allow the routine to Testing 32bit Windows Btrieve clients against interpret what field should be matched to the key buffer parameter. B-STRESS any Btrieve kernel: benchmarking, robustness Given a Btrieve call to get TITLE_ID “0000012”, a more reasonable NEW $79 tests, client-tracing, generating testdatabases. approach might be to create a connection with a Select statement like: Mirroring Btrieve files at runtime: without SELECT TITLE_ID, stopping Btrieve, improved security, B-MIRROR

TITLE, approaching replication. NEW (on request) TYPE, PUB_ID, PRICE, Advanced Rollforward for Windows: Logfile- ADVANCE, B-ROLL Tracing, stop at a selected operation.

ROYALTY, NEW $239 YTD_SALES, PUB_NAME, CITY, STATE, Enter the road to KnowWare COUNTRY http://members.aol.com/knowwarede

FROM TITLEPUBLISHER KnowWare Software-Systeme GmbH WHERE TITLE_ID = '0000012' Steubenstrasse 9 D-33609 Bielefeld Tel: (+49) 521 93259 0 Fax: (+49) 521 93259 11

Btrieve Developer’s Journal Autumn 1997 23 Send questions to Col. Micro at ASK COL. MICRO [email protected] “If you want objectivity, get your own column.”

Col. Micro, Sir: sound like database administration tasks. I know the high corporate poo-bahs in charge of the marketing mantra at Pervasive Software I was doing some testing with the 32-bit version of Crystal would rather you believe that their products require no Database Reports 5.0, and noticed that when going against a DDF and after Administrator, and hence by inference no database administration. But closing Crystal down, it takes about 28 seconds to close the I also know the difference between sunburn, seaweed, and sand in the MicroKernel. I tried this in Access 7 and got the same results. Do sheets, and a beach bimbo beer commercial. you have any idea why this is happening? If you’re using DOS BTRIEVE.EXE to allow concurrent access, either from different workstations or from the a program or programs D.G., Vancouver, British Columbia running on the same workstation, to files stored locally or on a peer-to- peer network, then you need to have SHARE.EXE loaded or file cor- The Colonel Responds: ruption may result. On a stand-alone MS-DOS computer running a sin- gle application that opens the same file using two different position I had heard rumors that the MKDE was actually counting slowly blocks at the same time, updating on one of the position blocks with- to 30 before it decided you were really serious about shutting it down, out SHARE will trash the file pretty much invariably and instantan- all the while muttering “Dave? What are you doing, Dave?” I had iously. The voice of experience speaketh. assumed that this was just one more example of the overall trend Giving different workstations or programs concurrent access to towards intentionally obstinate software, but a reliable source at the same files without imposing some discipline in what flavors or ver- Pervasive tells me “that’s just how long it takes to flush and finish the sions of Btrieve are being used is a good recipe for trouble. Decide background processes and release all the resources.” A less tenacious where you want to put the files and how you want them accessed, and old dog would probably accept that official statement. But it would make all the applications that plan to handle them at the same time make sense, then, that a Pentium 166, legendary for its ability to come conform. If you want to put them on a server and open them with a to the wrong conclusion faster while sitting on the can contemplating server-based engine, make sure all workstations and applications are remainders, ought to be able to finish, flush, and release faster than a using the correct requesters. If you are using client-based Btrieve, 486/40, otherwise why pay all that money to upgrade? The dog tried it make certain that the versions and settings for all workstation engines and it just ain’t so. Good thing too, since your average Jack Russell are identical, and that any concurrency control resources such as pre- can only count to around 18, which is why you’ll never see one suc- image files or transaction control files are set up correctly for the ver- cessfully boil an egg. When all else fails, blame Microsoft. Usually sion you are using. works for me. This may sound obvious, but don’t plug everything into a long skinny extension cord strung across the hallway, or go rooting through Col. Micro, Sir: dumpsters in the alley looking for new hard drives for your server. Software can only do so much. By the same token, don’t plug your Currently, we are using Magic 5.7 with Btrieve on a file server, your coffee pot, your copy machine, and your hair Novell 3.1 server. Late last week we had a file corruption dryer all into the same outlet. Computer equipment used to on a 105 megabyte Btrieve file. By corruption, I mean command more respect than that. that the index seemed to be acting strangely. It would Make sure you have enough memory and resources allo- scroll sequentially and then skip records and jump to a cated for Btrieve to do what you’re expecting of it. Running lower sequential set of records. I tried using BUTIL to out of disk space in the middle of a file update, for example, recover the file but it failed with a duplicate key (status is Not A Good Idea. And don’t delete the guy who owns the 5) message. It only loaded 113,000 of the 388,000 files. Example: Joe is logged in to the network, and runs the records. I ended up using a backup and running the company’s mission critical app, and creates some new daily transaction against it. What are the possible data files on the server. The network assumes they causes of such a corruption and what can be belong to Joe. Joe gets a pink slip. Before the done to prevent it from happening again? head knockers also fire Joe’s boss, a middle management type who serves as part-time A.D., Somewhere, Known Universe network administrator, they ask him to clean up the network accounts, so Joe’s account The Colonel Responds: gets the virtual axe as well. Now as far as the network’s concerned, the corporate Remember that file corruption and sales data files don’t belong to anybody, data loss are pretty much synonymous and the next morning all hell breaks concepts. Only by sheer dumb luck and loose as Btrieve and the network argue the most implausible coincidence will you over who has permission to do what. be able to restore everything back exactly Since the only two people in the office the way it was before. This is why a gram who knew anything about the system are of prevention has a higher street value than a gone, it’s not until they try to run the daily kilo of cure. sales report that somebody decides the rash of There are certain things you can do to Btrieve status 18 and 14 messages they’d been defend your files against the slings and arrows of bad karma. Some of these will See Col. Micro, page 28

24 Autumn 1997 Btrieve Developer’s Journal Embedded Embedded Database? By Jim Kyle Database? [email protected]

For almost a year now, nearly every press release from Pervasive desktop applications up to enterprise level, but few are successful. Software Inc. has identified Btrieve and Scalable SQL as “embedded Thus this classification, while inexact, is useful for preliminary plan- databases.” Since I was under the impression that Btrieve was a navi- ning at least. gational database, and that SSQL was relational, the unfamiliar adjec- tive finally prompted me to ask some questions. Enterprise Database Attributes Had something changed in the way databases are being classi- fied? Historically we’ve had network databases (not to be confused The enterprise-wide database is typified by packages such as with client/server operation; these were back in the Sixties and made Oracle or IBM’s DB2. These stand apart from all the applications that their way into the COBOL standards), hierarchical databases, relation- connect with them, and normally require specialist support both for al database management systems, and even object-oriented databases. installation and for day to day maintenance. In most organizations that The embedded variety, however, seemed to be something new. use an enterprise database, a database administrator takes care of all So what happened to change Btrieve’s classification, not to mention the day to day needs. that of SSQL? A typical enterprise database runs on either a mainframe or a As it turns out, nothing at all happened to the classifications. large network. While many firms are experimenting with distributing Btrieve still follows the navigational model, and SSQL is rela- their enterprise databases over a wide geographic area, the tional. Nevertheless, both products are also firmly in the majority of this class still operate from a single location camp of embedded databases, and thereby and serve nearly all needs of the parent company. This hangs our tale. single-site approach makes for more economic mainte- nance, but exposes the stored information to the dan- Shades of Humpty Dumpty ger of total loss in case of a localized disaster. From the very beginning of the Characteristics of the Desktop Database computer industry, long before the rise of microcomputers, we’ve had a At the other end of the spectrum, desktop data- problem communicating with the rest of the bases consist of such programs as the multitude of world. Much of our theory is based on xBase variants, Paradox, or Microsoft’s Access. logic ideas put forth by George Boole and These databases usually reside on a single indi- C. W. Dodgson in the middle of the last vidual’s desktop system and don’t integrate century. It’s no accident that much of the directly with the needs of anybody other than language with which we describe what we their owners. do follows a rule enunciated by Dodgson’s Few desktop databases require extensive alter ego, Lewis Carroll, as spoken by Humpty daily maintenance, but their ability to serve multi- Dumpty: “When I use a word, it means just what I ple needs is also small. Organizations with more want it to mean, no more and no less.” than a very few employees tend to downplay the For instance, we deal with character “strings” all use of such databases since information stored in the time, but they’re totally useless for tying up a them isn’t readily accessible to all the people who may package to be mailed. Most of the “words” we use are need it. larger than just two bytes, also. A “disk file” can’t be used to smooth the edges of a circular piece of , Where Pervasive’s Products Fit nor will a memory “buffer” put a high polish on our Where in this deployment spectrum do Pervasive’s products fit, as minds. Yes, our vocabularies are stuffed to overflowing embedded databases? According to Craig Lakey, director of corporate with “ordinary” words that have special meaning. communications for Pervasive, they fit squarely in the middle. “Our Often, as with “memory,” the words have multiple products,” he says, “form a component part of an application.” That is, special meanings, depending on the exact context to distin- they’re neither so complicated as an enterprise database, nor are they guish which we mean. That’s what has happened in the database clas- limited to a single desktop, although both Btrieve and Scalable SQL sifications. An “embedded” database can be relational, navigational, can be found at both ends of the spectrum also. flat-file, or have any other organization structure. What makes it “Our primary market,” says Lakey, “is the middle market.” Rather embedded is that it becomes an integral component part of the applica- than targeting an entire enterprise, Pervasive aims its products primari- tion making use of it. ly at the “departmental level” of operation. To do so, the firm concen- trates on working with independent software vendors who create spe- The Deployment Spectrum cific business applications for this level. Databases can be classified according to the way in which they’re deployed to their end users, just as they can be by structural organiza- The Compleat Application tion. The deployment spectrum ranges from enterprise-wide systems at In his book, The Compleat Angler, Isaac Walton wrote the defini- one extreme, to desktop-only applications at the other. tive guide to the art of catching fish. Similarly, Pervasive currently Note that this classification is somewhat loose. It’s possible, markets Btrieve and Scalable SQL primarily to creators of specific though seldom practical, for an enterprise database to be used as a business applications such as accounting or MRP. “We consider our desktop application. Similarly, many developers attempt to scale the

Btrieve Developer’s Journal Autumn 1997 25 product to be a transparent component of that business application,” to a version that uses the newer version of Btrieve. The upgraded Lakey explained. “It doesn’t stand alone. We consider the database to application was an appointment scheduling system known as “On- be part of the application.” This allows the configuration to be tuned Time.” However that’s far from being the only such conflict. “Anyone by the application’s creator, he went on to say, so that everything who installs Btrieve software should be conscious of existing Btrieve works properly out of the box. applications,” Hosfield points out. “It must be determined which appli- Ted Doucet, vice president of sales for Pervasive, carried the cations employ Btrieve and what the versions are.” explanation a step farther. “I look at an embedded database,” he said, Another area of conflict involves the BTI.INI file, which some “from the ISV’s perspective. By using an embedded database the ISV applications blindly overwrite with their own version at install time. can make sure his application is completely integrated with the data- For this reason, Hosfield considers it essential to make a copy of this base and that everything has been fully tested. This makes for a file before installing other Btrieve applications. smooth process.” “I have experienced problems with pre-existing applications after Doucet pointed out another advantage to the ISV, whether the installing other programs that have overwritten the BTI.INI file; there- publisher distributes the application through direct sales, or by means fore, pre-existing Btrieve settings that fulfilled the requirements of the of local resellers who handle the actual installation at customer sites. original Btrieve application were lost,” she reports. “This typically Since the embedded database is already integrated into the application results in the inability to launch the original application. Peachtree and is mostly pre-configured, it increases the “channel capacity” for Accounting for Windows is such an application. Peachtree says to re- sales. That is, by minimizing the time necessary to install each copy, install their software; however, this may not be appropriate. It could the seller can devote more time to making additional sales. cause problems with other applications that share the BTI.INI file. You must manually edit the file with the appropriate settings from each How About Scalability? vendor, taking into consideration that the minimum requirements must be established for each software application.” Positioning Btrieve and Scalable SQL near the midpoint of the deployment spectrum might raise questions about their scalability. The Bottom Line However both products have long histories of operation from the smallest scale operations to some of the largest. The positioning, it That brings us to the end of this exploration. Now you know what turns out, is more a matter of Pervasive choosing its primary market Pervasive means by referring to their products as “embedded databas- target than it is of any technical limitations. es” and why they’re doing it. It’s not any limitation on what Btrieve or Scalable SQL can do, but simply the company’s method for targeting When Worlds Collide their primary market for the products. One potential drawback to embedding the database engine into an application is the possibility of conflict with some other application Jim Kyle, author of Btrieve Complete and a Btrieve developer since that also uses the embedded database, but at a different revision level. 1991, is a frequent contributor to Btrieve Developer’s Journal. When the user attempts to install both applications on the same sys- tem, be it network file server or individual desktop, such conflicts can be disastrous. Windows users already know the effect well. Certain shared DLL files, that form part of the system itself, have just such incompatibilities. Book Brief I asked Doucet about the effect of such conflicts when Btrieve or Windows NT in a Nutshell Scalable SQL is the embedded database in question. He pointed out By Douglas Reilly that the Pervasive products maintain an extreme degree of reverse [email protected] compatibility from one version to another. Because of this compatibili- ty, most applications that embed an older version still work quite com- What, might you ask, is a review of a Windows NT book doing in fortably with newer versions of either product. Thus, so long as the lat- Btrieve Developer’s Journal? Historically, we Btrieve developers have est embedded version becomes the one used by the system, problems been a NetWare-centric bunch since Btrieve, as a former product of remain minimal. Installation programs should make certain that they Novell, was one of the first widespread server-based record managers. never replace newer versions by older ones, however. In this age of Networking Operating System independence, more and “In the vast majority of cases,” Doucet told me, “such conflicting more of us are moving to NT. applications work together without trouble. If they don’t, then we get If that is your situation, run, don’t walk, to get a copy of Windows involved and resolve matters. NT in a Nutshell by Eric Pearce. The information contained inside is It isn’t always that simple, however. One consultant who has for the most part available elsewhere, but nowhere have I seen such a experienced several such conflict problems is Jerilyn Hosfield, founder clear and well-structured presentation. The emphasis on the power of and CEO of HealthWare Systems, Inc., in Phoenix, AZ. HealthWare many of the NT command line tools will strike a chord with the com- Systems is a value added reseller of healthcare computer products, net- mand line fanciers, and even those brought up in a GUI will marvel at working, training and technical support services to the healthcare some of the tasks that can easily be performed from the command line, industry. using the advice presented. “The biggest problem that I have encountered,” she reports, “is The menu maps for the GUI system tools make finding obscure when an application uses Btrieve V6.x or higher and an existing appli- commands a little easier. A chapter entitled “Uncommon Sense” tops cation utilizes an earlier version of Btrieve.” off the book. This is must reading for any new NT power user or The usual indication of such a problem, says Hosfield, is to see administrator. Btrieve status errors when entering the application that uses Btrieve There are other sources of information on NT. Many of the com- V6.x, after launching an application that utilizes the earlier version of mand line tools have /? options to allow you to derive the usage, and Btrieve. “Since Btrieve becomes memory resident upon launching the GUI utilities have on-line help. But in both cases, you need to know application,” she says, “it is necessary to reboot the computer to what you are looking for. The NT Resource Kit provides some of the launch an application that employs a conflicting Btrieve version. Of same information, but at a cost that is much greater. If NT is your cur- course, this is not a viable option for an end user.” rent headache, or coming on the horizon, Windows NT in a Nutshell is Hosfield resolved this problem by upgrading the older application a resource you need. 26 Autumn 1997 Btrieve Developer’s Journal Inside ...continued from page 23 worthwhile to further explore. First, you might want to actually Server conversion, Microsoft’s web page also contains references to change databases. On a smaller scale, some time ago I needed to “embedding” SQL Server into your application. Hmm. Sounds like convert a Btrieve DOS based application to operate on a Unix-based what many developers do with Btrieve. It looks like Pervasive will system. I selected C-ISAM as the record manager on the Unix side, be in for an interesting few years. and then created a BTRV() function that simply mapped operation codes from one system to the other, allowing me to keep the BTRV() Listing 1 - Exports section of exehdr dump of 32 bit WBTRCALL.DLL. call semantics in the actual application level code. Had the client had more money, and I more time, creating the code to map to SQL Exports: instead would have allowed for future growth and change in the ord seg offset name application. Further, the application could have used SQL style tools even on the Unix side. The example presented by Microsoft is not 6 17 0000 WEP exported, shared data the only possible database API mapping that someone might want to 4 9 0000 WBTRVSTOP exported, shared data do, and it is just as possible to map to the Btrieve API as away from 104 1 0a3a BTRIEVEDEBUGSTATS exported, shared data it. 1 1 0000 BTRCALL exported, shared data Why would a Btrieve developer want to map a Btrieve API- 9 5 0250 BTRCALLBACK exported, shared data based application to Scalable SQL? Suppose that you have a large system, mostly Scalable SQL, but with significant, ugly to convert, 7 1 03e4 BTRCALLID exported, shared data Btrieve API-based components. You want to use a Scalable SQL 8 9 03ba WBTRVIDSTOP exported, shared data only features, like triggers, but cannot rest easy until the Btrieve API- 5 2 0000 WBRQSHELLINIT exported, shared data based portions of the application can use these features as well. 3 5 0000 WBTRVINIT exported, shared data Short of waiting for a future release of Scalable SQL and Btrieve, 2 5 0070 WBSHELLINIT exported, shared data mapping the Btrieve API calls to Scalable SQL is the answer. Listing 1 - C language structures for the two tables in the Btrieve Can you trust Microsoft as a source of information? Wrapper example. While the information provided in the white paper is interesting, /**************************************************** is it reliable? For the most part, yes it is. Of course, there are excep- Data Record Structure Type Definitions tions, and in many cases, the information is geared to get you to ****************************************************/ switch to a Microsoft product. //titlepub record structure For example, the white paper says: struct{

Btrieve does not provide a way to back up the data files while Inside con’t., page 28 they are online and in use. The data file must be closed while backups are performed. SQL Server provides the ability to back up both the database and the transaction log while they are online without having to shut down the server.

This is simply not true. With Server-based Btrieve (the “flavor” of Btrieve that is reasonable to compare with SQL Server) you can Play CAT use Continuous Operations to backup a snapshot of the database while other users operate on the database. Also, the white paper states: & mouse. Btrieve does not offer any tools for monitoring performance. Performance monitoring tools are very useful when trying to analyze the throughput of the system. SQL Server can easily be monitored using Windows NT Performance Monitor.

This is also not entirely true, since some aspects of performance With ActiveX Controls For Btrieve With can be monitored with BTRMON in the NetWare server-based ver- Code Avoidance Technology (CAT), Everyone Wins. sion, and NT includes some performance monitoring that can assist With no new development languages to learn in analyzing performance. Other digs at Btrieve, and by extension or restrictive environments to work in, Scalable SQL, are less off the mark, especially in areas like automat- ActiveX Controls for Btrieve is winning lots of friends among database developers. It’s quick. It’s smart, independent, ed administrative support, like the SQL Executive provided by SQL and an indispensable database partner. Check us out at Server that can automate tasks like backups. www.smithware.com/cat or call Smithware, when you’re ready to play with the best. Conclusion In addition to what is stated in the white paper, some things that Btrieve developers take for granted cannot be assumed in the SQL Server world. For instance, that a file will grow as needed. Monitoring is required, since database maximum size is a setting in Smithware, Inc. 2416 Hillsboro Road, Suite 201, Nashville,TN 37212 the database, and moving beyond that size requires user intervention. Phone: 615-386-3100 or 800-828-7438 So, as Pervasive tries to “own the gap,” is the gap getting crowd- e-mail: [email protected] http://www.smithware.com ed? I think so. In addition to the white paper on Btrieve to SQL

Btrieve Developer’s Journal Autumn 1997 27 ¥ Five, acts of war. Carpet bombing, artillery barrage, snipers, Inside ...continued from page 27 Microsoft Office 97 or some other computer virus. char TitleID[7];//string And the only certain thing is that you will loose it at the worst char Title[81]; //string possible time. Why will it be at the worst possible time? Because the char Type[13]; //string fact that you notice you’ve lost it means that you were looking for it. char PubID[5]; //string float Price; //money Col. Micro, Sir: float Advance; //money int Royalty; //integer Can you recommend a resource to assist me in accessing and int YTD_Sales; //integer rebuilding the header of a Btrieve data file? We have a severely cor- char PubName[41]; //string rupted file and no backup to restore. Do I have options? Thanks! char City[21]; //string char State[3]; //string J.B., Holland, Michigan char Country[31]; //string }tpRec; The Colonel Responds: //sales record structure struct Having no backup to restore is inexcusable, son. See above. However, realizing that all of your data may well be toast, you can try { downloading and running Jim Kyle’s DATASAVE program char StorID[5];//string (http://www.smithware.com/bdj/datasave.html). If that doesn’t work char TitleID[7];//string and you’re desperate to have anything back you can get, you’ll want to char OrdNum[21]; //string find a good hex editor program that will let you poke around the guts int Qty; //integer of binary files. Keep a copy of the original corrupt file, what follows is char PayTerms[13]; //string complicated and you’re likely to have to start over from scratch. }salesRec; First you will have to be able to obtain or create a new empty Btrieve file which has the same structure as the damaged copy, with the same Btrieve version file format, page size, record length, number of keys, and other characteristics. If you can’t produce a good empty Col. Micro ...continued from page 24 clone of the original file, for the purposes of this procedure your cor- rupt file is little more than a waste of disk space. Pitch it, take the rest getting all day must have meant that a very bad thing has happened. of the day off, and while you’re out pick up a backup storage device. True story, more or less. Determine the page size of the file. Valid Btrieve page lengths are Never be the first on your block to try the latest release or patch. multiples of 512 bytes between 512 and 4096 inclusive. For what it’s Who, me paranoid? Maybe, but I’d rather let somebody else find the worth, the page size is stored in the header page beginning at offset 8 one big gotcha that the QC and beta teams missed. On the other hand, as a two-byte integer, but then again, if you can’t read the page size there is such a thing as taking the “if it ain’t broke, don’t fix it” philos- from a BUTIL -STAT report on the new clean copy, wading through ophy to the extreme. If you’re still trying to use Btrieve version 4.11a the rest of this isn’t going to do you much good. under Windows NT, you may have reached that extreme. Determine the number of pages in the damaged file by dividing And finally, always make sure you have a backup you can use. the file size by the file’s page length. Convert the number of pages in No matter how careful or how lucky you are, gremlins will eventually the damaged file to a hexadecimal value. Then swap the first and sec- beat you. Once found a fragment of a Hewlett-Packard PCL print job ond byte values, and the third and fourth byte values. For example, if in a system configuration data file that had been in use every day, but the file contains 100,000 pages, the 4-byte hex equivalent value would never modified, for six years. How it got there is anybody’s guess. The be 00 01 86 A0, and swapping the bytes in each word results in the 4- award for best implausible theory went to the dog, who speculated that byte hex value 01 00 A0 86. the flaming debris from a chance collision of unrelated network pack- Open the new file in your hex editor and replace the four bytes at ets had conspired to convince the Btrieve server engine that it should offsets 26h through 29h with the value calculated above. Select and insert a few bytes of the print queue as a new record in the first open copy this clean first page. Remember, the number of bytes in the first file it found. header page is the same as the page size discussed above. It hurts me to remind intelligent and experienced folks of this, 15 Open the damaged file and replace the bytes of the first page with years after the introduction of the personal computer, but, please peo- the clean first page you copied from the new file. If the file is Btrieve ple, if you care about your data, back it up. No matter what, if you’ve version 6 or later format (the first two bytes of version 6 and later files only got one copy of whatever it is encoded in the magnetic polarity of are “FC”), you will have to replace the first two pages of the file with ephemeral bits of ferrite, the question is not if but when you will loose the clean header page. it to one of the following causes, listed in descending order of statisti- Then you can attempt to use BUTIL, DATASAVE, or a similar cal probability: file recovery tool to try and recover some data from the file again. Who knows, you may get lucky. And at worst, you can always go pok- ¥ One, stupidity. You, or someone you know, will accidentally ing through the file looking for the date of your anniversary with the delete it. hex editor, or just accept this as an opportunity for a fresh start and a ¥ Two, software malfunction. Something will go wrong, and what good excuse to go buy a tape drive and some roses. went out won’t come back in. ¥ Three, hardware deterioration. If it works, then it will eventual- About the Colonel: Col. Micro, Ret., and his faithful dog Napalm, stand ly break. ready to fight for truth, liberty, justice, and better software, asking only ¥ Four, acts of God. Lightning, flood, meteorite strike, airline dis- a cup of coffee, a cigarette, and two aspirin in return. Send questions to aster, gnawing rodents. Col. Micro at [email protected]

28 Autumn1997 Btrieve Developer’s Journal Smithware Tech Talk is a regular supplement to Btrieve Developer’s Journal, providing the latest information about Smithware products.

http://www.smithware.com

Home What’s How to Support BDJ Company Contact Page Hot Products Order Magazine Info Us

SmithwareDevWire Mailing List made aware of this and in working on the problem; in the meantime, Join the SmithwareDevWire mailing list to get the latest infor- this patch will allow Delphi 3 to use the Smithware ActiveX Control mation from Smithware via e-mail. Updates about new patches, for Btrieve. products, versions, late breaking news, and development issues The files included with this patch are the *.PAS files used by as they arise. Sign up at http://www.smithware.com/contact/ Delphi to wrap the Smithware ActiveX controls. They should be devwire.html . placed over those built by Delphi 3 when the ActiveX was originally imported (the ActiveX must be imported before this patch will work). Current Versions of supported products The default directory for these files is \Delphi 3\Imports. PRODUCT VERSION Note: These files must be named the same as the “bugged” versions created by Delphi. Typically they will be called ActiveX Controls 3.10.005 ACCtrlLib_TLB.pas and VaccessLib_TLB.pas. These names can Class Library 4.00.000 vary from station to station, so check the old names before apply- Crystal Reports for Btrieve 5.0.1.108 ing the patch to account for this possibility. DDF Builder 2.51.012 In addition, the library into which these files will be added must DDF Sniffer 1.50.004 Internet Data Server 1.00.000 See Tech Talk, page 30 VBX Controls 2.50.012

New Patches and updates - A file listing for each component of the patches can be found at the Smithware Tech Support Site http://www.smithware.com/patches.html This CAT’s classdef.zip (7K) Class for the VC5 environment that contains both the runtime and design time properties. (PKZIP format). got your delphi3.zip (11K) Corrects for Delphi3 bugs with OCX control's methods. (PKZIP tongue. format).

5vcldel3.zip (174K) This file contains the Crystal Reports VCL component for Crystal Reports 5.0, 32-bit (Component Version 2.5.0.32). It has been re- For Database Development Without The Language compiled in Delphi 3, so that the DCU will install properly (without requiring the PAS source file). There are no new properties in this Hassles,Ask For ActiveX Controls For Btrieve With compilation, it is the same VCL as was shipped with Crystal Code Avoidance Technology (CAT). 5.0.(PKZIP format). Now you can develop Btrieve database applications without learning new languages with ActiveX Controls for magiccrw.exe (1415K) Btrieve. You choose the environment to work in, so there are Smithware Crystal Reports for Btrieve version 5.0 Magic driver fewer snags in your pursuit of a high-performance and tools update. This file should be downloaded and then it database solution. Visit www.smithware.com/cat should be run. Password protected. Resolves logical path name or call us. At Smithware, we speak your language! issues and password issues. See related FAQ #000369 and FAQ #000370 for more details. Contact Smithware Technical Support with your registration information to receive the password if you need this patch. (Updated as of 08/05/97).

New Knowledge Base Articles Smithware, Inc. 2416 Hillsboro Road, Suite 201, Nashville,TN 37212 Delphi 3 bugs, ActiveX, and Methods Phone: 615-386-3100 or 800-828-7438 Delphi 3 has a problem with calling methods on some e-mail: [email protected] http://www.smithware.com ActiveX controls, particularly non-visual ones. Borland has been

Btrieve Developer’s Journal Autumn 1997 29 Tech Talk ...continued from page 29 be rebuilt before the patch will take effect. In Delphi 3, the libraries Reposition event are rebuilt as needed by default, so the patches should compile and when used with a project. Otherwise, you will need to change your VAccess1.FieldValue(0)= Text1.Text library settings. to the text's box Change event. If the library which contains the ActiveX controls is rebuilt from the ActiveX controls themselves (i.e., the controls are VAComboBox overwrites VB label objects removed and re-added to the library), these files will be over-writ- A VAComboBox will “cover” other items on its form when it ten by those generated by Delphi. These patch files will obviously drops down. When you select the item in the VAComboBox and it need to be re-copied over the newly generated files. Please go to shrinks back, any “label” objects that were underneath it will have Patches and Updates and obtain the file delphi3.zip to correct for disappeared. This is because VB paints the label onto the form and this problem does not refresh it after an event such as the VAComboBox dropping over it. Adding the Smithware ActiveX Controls to a development Solution: environment The workaround for this is to use a Visual Basic Textbox object and Follow the steps for your particular environment. If your devel- change the following attributes: opment environment of choice is not on this list please consult Text = the text you would have put in “caption” of a label object your online help. enabled = false Borland C++ Builder backcolor = buttonface (VB5 only) Component | Install | Press the ActiveX button | Select Controls backcolor = ? (VB4, make it match the form color) from Registered Controls List | Press “OK” border = none Borland Delphi 2 appearance = flat Component | Install | Press the OCX button | Select Controls from tabstop = false Registered Controls List | Press “OK” Borland Delphi 3 Status 3 when trying to save a table definition Component | Import ActiveX Control | Select Controls from In DDF Builder, when you create a new set of Data Dictionary Registered Controls List | Install | Install into New Package | files and then try to “add” a table definition, you cannot “save” the Confirm rebuild if necessary table but will get the following message: Microsoft Visual Basic 4 Error establishing the new fieldID from FIELD.DDF Tools | Custom Controls | Select the Controls Btrieve status = 3 Microsoft Visual Basic 5 Solution: Project | Components | Controls tab | Select the Controls The workaround is to create the new Data Dictionary files, then close Microsoft Visual C++ 4 them and finally re-open them. Then you can add tables and save Insert | Component | Click the “OLE Controls” tab | Select them without errors. “Smithware ActiveX for Btrieve” | Click “Insert” | Click “OK” on the (Applies to DDF Builder 2.51.012) dialog that pops up | Click “Close” (You will have a CVAccess class added to your project) DDF Builder and creating data files with long filenames Microsoft Visual C++ 5 On a Windows 32-bit operating system that allows for long file- Project | Add To Project-> | Components and Controls | Double- names (greater than 8 characters with a 3 character extension) when click “Registered ActiveX Controls” | Select “Smithware ActiveX for DDF Builder creates a table with the table location as a long file- Btrieve” | Click “Insert” | Click “OK” on the dialog that pops up | name, the data file will be created without an error message but the Click “OK” again (another dialog) | Click “Close” (You will have a filename will be truncated to the 8.3 naming convention. This can be CVAccess class added to your project) avoided if a 32-bit Btrieve engine is used instead of a 16-bit engine. For a 16-bit application such as DDF Builder turning the Thunk How to change the TABLE LOCATION's on the fly option on in the BTI.INI file will allow for DDF Builder (or any 16-bit Every product handles this issue in a different manner. Also, Windows based application) to use the 32-bit engine. each situation where this is necessary may be different the data could be in one of several directories or data files or files could Creating instances of the VAccess Control in Visual Basic have the same file names in different locations, or the same loca- To create multiple instances of the VAccess control in a Visual tion but different file names etc. So how do you specify the file Basic environment use code similar to this. location? Private Sub LoadVAccessControl(NewIndex As Integer) ‘This SOLUTIONS: changes the name of the original control to the name of the new Crystal Reports for Btrieve loaded control VAccess1(0).VAccessName = “VAccess1(“ + set table location on the report using the Database menu option Str$(NewIndex) during report design, at runtime use the the DataFiles( ) property + “)”Load VAccess1(NewIndex) ActiveX/VBX Controls for Btrieve VAccess1(NewIndex).DdfPath = “Your DDF Path” set the FileLocation property of the VAccess control either at run- VAccess1(NewIndex).filename = “Your Table Name” time or at design time ‘Default property of the VAccess control is the Name property DDF Builder VAHScroll1.VAccessName = VAccess1(NewIndex) edit the table location or specify a different one when using the VAText1.VAccessName = VAccess1(NewIndex) Edit Data option VAText1.VAFieldName = “Your Field Name” VAccess1(NewIndex).Open Use of Arrow keys and the ActiveX Controls VAccess1(NewIndex).GetFirst In Visual Basic the use of arrow keys to navigate inside of a End Sub text box perform like tabbing though the various text box controls. Private Sub LoadVAccessControl(NewIndex As Integer) This is a known issue and is due to aggregation problems in the Load VAccess1(NewIndex) Visual Basic environment. The arrow key input is not being trans- ‘Change the name of the loaded control to its new name. ferred from the Visual Basic environment to the ActiveX Controls. VAccess1(NewIndex).VAccessName = “VAccess1(“ + Solution: Str$(NewIndex) + “)” To avoid this issue use a normal VB text box. To emulate the VAccess1(NewIndex).DdfPath = “Your DDF Path” ActiveX text box add the lines of code similar to this VAccess1(NewIndex).filename = “Your Table Name” Text1.Text= VAccess1.FieldValue(0) n the VAccess control’s ‘To Bind Bound Controls to the new VAccess control do the fol-

30 Autumn 1997 Btrieve Developer’s Journal lowing: control. Respond with OK and then recompile the form and you will ‘Default property of the VAccess control is the Name property be prompted to remove the offending declarations and continue with VAHScroll1.VAccessName = VAccess1(NewIndex) rebuilding. VAText1.VAccessName = VAccess1(NewIndex) VAText1.VAFieldName = “Your Field Name” Contacting Technical Support VAccess1(NewIndex).Open Following this procedure will expedite your support request. VAccess1(NewIndex).GetFirst 1. Download the Latest Product Patches or Revisions http://www.smithware.com/patches.html Status 95 BSTART.NCF and the ‘R’ option To make sure you have the most recent version of the Smithware Using a Btrieve for NetWare version 6.10 server engine in product you are using. conjunction with 32-bit requesters running on Windows NT or 2. Access the Smithware Knowledge Base Windows 95 workstations will result in SPX timing problems, often http://www.smithware.com/support/kbase reported as a status 95. If you are using a 6.15 version of BSPX- The Smithware Knowledge Base contains answers to the most COM.NLM the following option may correct the error. commonly asked questions, helpful hints, technical tips, and arti- From the Btrieve v6.15 Requester Update November 1995 cles from Smithware’s database of known issues concerning the README.TXT operation of all supported products. ** To support the new Btrieve for Windows 95 requester, a new 3. Submit a Support Request Form via the Web command line parameter has been added to BSPXCOM.NLM in http://www.smithware.com/support/support_email.html this release. This parameter, -r, allows you to configure the maxi- You may use this web-based form to submit a request to mum SPX receive packet size. The default and minimum is 576 Smithware Technical support. Please be sure to fill in as much and the maximum is 4096. If you are using the Btrieve for information as you can, and include as many pertinent details as Windows 95 requester, load the new BSPXCOM on your NetWare possible about the symptoms of your problem or the error server with the -r parameter set to a value appropriate for your messages you are receiving. network topology. For example, on an Ethernet LAN, set -r=1500. 4. Contact Smithware Tech Support note that this option is set in the BSTART.NCF file on line that If you need further assistance you may contact Smithware looks similar to this LOAD BSPXCOM -d=8192 -s=15 -w=3 - Technical support directly as outlined below. r=1500 Web site: http://www.smithware.com/support e-mail: [email protected] Borland RAD Tools, ActiveX Controls and EOleSysError’s or Telephone: 615-386-3100 extension 7 Unspecified OLE Error’s Fax: 615-386-3135 Upgrading to a new version of the controls leads to our sam- Mailing Address: ples or your applications to no longer operate in Delphi or C++ Btrieve Smithware, Inc. Builder. The errors that are generated are in the design environ- Developer’s 2416 Hillsboro Road, Suite 201 ment “Unspecified OLE Error” and in the runtime versions Journal Nashville, TN 37212 “EOleSysError”. USA The cause of this situation is that Delphi (and other Borland RAD Tools) wraps the OCX very tightly and hardcodes the number of properties, their dispatch ID's (dispid’s), and their values into both the executable and the form/library combination (i.e., the design time files). If an OCX ever changes, it has problems. We have not changed the dispid’s of any properties since the release of the ActiveX Controls product. However, because of a few enhancement requests, we have added a couple of properties in Free some of the bound controls (these are additional dispids). The most notable of these is the VAListbox and the VAScrollbar. Delphi has a hard time dealing with these extra properties, even though they should not affect it in the least. This is Delphi’s design, and in this situation it leads to this poor behavior. A solution to this situation for an executable that will not run CAT. due to these new properties is that you must recompile the app. However, as stated previously, this problem affects both run-time & design-time files. Thus, when you try to recompile the app, you get an “Unspecified OLE Error” on the attempt to load the form. Adopt A New Breed Of Database Development Tool– Rather than just forego the offending component, Delphi refuses Smithware ActiveX Controls For Btrieve to load any of the form. Thus, you must edit the form as a text file. With Code Avoidance Technology (CAT). The form file, .dfm, is a binary file. To change it to a text file, you have to run a utility that comes with Delphi, CONVERT.EXE. This Write powerful client/server database applications in your favorite development environment without learning can be found in the BIN subdirectory of the Delphi install directory. new languages and with no special training required. To use this, type: Check us out at www.smithware.com/cat CONVERT or call for complete papers on ActiveX Controls for Btrieve, the newest breed of CAT from Smithware. The file will be converted from a binary form file to a text file or vice-versa. You can convert the form, and bring the text file up in a text editor. Then, the offending component can be removed manually. After removing all the problem components (listboxes & scrollbars), the form can be converted back to a *.DFM file with the same CONVERT.EXE utility. The form should load up and Smithware, Inc. 2416 Hillsboro Road, Suite 201, Nashville,TN 37212 compile in the IDE from then on. You may now add list boxes and Phone: 615-386-3100 or 800-828-7438 scroll bars to the form and reset the appropriate properties. The e-mail: [email protected] http://www.smithware.com error “A field or Method named ______already exists” may be generated when you attempt to add another copy of a removed

Btrieve Developer’s Journal Autumn 1997 31 TTension!ension! EasesEases Improooved! ReducesReduces Headaches!Headaches!ith Extras! LoadedLoaded WWith Extras! GreatGreat PPartyarty && GiftGift Ideas!Ideas! Nuuuuu!

Now Even More Btrieve Fun In Every Smithware Box! PROUD MAKERS OF: BUtility for DOS NEW! Smithware Smithware Smithware DDF Builder DDF Sniffer BUtility for DOS ActiveX I*net Data Crystal Reports •The #1 data definition tool •Have undocumented •Get the down and dirty Controls for Server for Btrieve used by professional Btrieve file structures? programmer’s tool for viewing Btrieve Developer’s Kit •Bundles the latest version of developers worldwide Don’t have a cow! and editing Btrieve files in •The high performance, •Build Internet database Crystal Reports Professional •Makes it easy to build, edit, DDF Sniffer automatically hexadecimal, decimal, or text. easy-to-use Btrieve data applications without using with our database tools– and maintain DDF files creates a DDF for you. •Perform any Btrieve operation access solution CGI, ISAPI, ODBC DDF Builder, DDF Sniffer, and •Milk this one for all it’s worth •Analyzes any Btrieve file, on a file. •Works in any programming •Developers kit gives you High-Performance Drivers for with the powerful based on the data it contains. •Easily edit any field by environment that supports the everything you need to do Crystal Reports import/export data functions, Just point it at the file, and let specifying field type, position, ActiveX standard Btrieve over the Internet •Supports extended data types Btrieve table copying, and Sniffer do the work. and length. Or, use DDF view •Code Avoidance Technology •Includes Java,ActiveX, and variable length records to on-line data viewing! •Requires DDF Builder. and edit functions. connect you to any kind of (CAT) makes using Btrieve DLL clients, lots of samples, $149.95 $229.95 $129.95 simple and fun and more! information Btrieve can store •Includes DDF Builder too! •Gets your report writing $595.00 mooooo-ving! $349.95 $495.95

Order one, two or all six by phone, fax, or e-mail. Smithware, Inc. Or order on-line at http://www.smithware.com 2416 Hillsboro Road, Suite 201 http://www.smithware.com Nashville, Tennessee 37212 e-mail: [email protected] 615-386-3100 © 1997 Smithware, Inc. All rights reserved. Smithware, Smithware Controls for Btrieve, DDF Builder, and DDF Sniffer are trademarks of Smithware, Inc. Crystal and Crystal Reports are trademarks of Seagate Software, Inc. Btrieve is a registered trademark of Pervasive Software, Inc. All other names or trademarks are registered trademarks of their respective manufacturers. Fax: 615-386-3135