Purpose:
1. Fix bug in C5B ABC templates that cause error 33 in SQL apps.
2. Allow autonumbering on backend and autonumbering in CW dictionary so parent/child forms work
With this done, Autonumbering in an SQL app and TPS app is the same.

Target:
1. C5B, ABC Templates, 32 Bit, MSSQL7.

Credits:
1. Surf (Scott Ferret) from TopSpeed initially released a similar template for SA Anywhere
but it didnt allow setting Autonumbering in both the back end and CW.
2. Jim Kane took Surf's work one step further and modified ABFILE to work arround some
restrictions related to private attributes.


To install:
MSSQL:
1. create a Database in MSSQL called Sql7test
2. In query analyzer run the script sql7test.sql twice - you may get drop errors 1st time.

CW:
1. put SQLAn.TPL in the template dir and register SQLAN.TPL
2. Put SQLAN.CLW and SQLAN.INC into libsrc
3. In ABFile.inc add two methods:
SetAutoIncDone	Procedure(BYTE pAutoIncDone)
GetAutoIncDone	Procedure(),BYTE
4. In ABFile.CLW add the code for the above two methods.
The source code is in ABFix.Clw
5. ABFIX.CLW has a fix to RestoreFile in ABFile that stops an Error 33 by enhancing error checking.
The Source for the fix to the RestoreFile method is in ABFix.Clw

Sample Application:
1. Run NewAI - autonumbered on the back end and CW is quite happy with it.
(Requireds C5B, MSSQL7 with Script to install needed tables, 32 bit)

To Use in Your app.
1. In MSSQL create an identity column for all tables you want autonumbered
2. In the CW dictionary, check autonumbering for the same tables as you usually would for a tps app.
3. Add SQLAN.TPL global extension to the app. SQLAN.INC/.clw in libsrc.
4. This assumes you have done the patching described above in abfile.clw/abfile.inc.

Jim Kane
Team TopSpeed