How To Convert A New Version of Gamebase To XBOX DAT Files
----------------------------------------------------------

This HOWTO is for people who are comfortable with a command line.

This will only work as long as Gamebase continues to be distributed as an Access
MDB file.

First, load up the GBC_v##.mdb file in Access.  

Create a new query called "xboxgames".  Create it directly in Design View mode
because we're just going to enter in straight SQL to construct the query. Go
to SQL View and enter the following SQL:

SELECT DISTINCTROW Games.Name, Years.Year, Games.Comment, Games.Filename, Games.ScrnshotFilename, Musicians.Musician, Games.GE_Id, Games.PU_Id, Crackers.Cracker, Games.SidFilename, Programmers.Programmer, Languages.Language, Games.V_PalNTSC, IIf([V_TrueDriveEmu],1,0) AS Expr1, Games.V_Length, Games.V_Trainers, Games.V_Comment, Games.V_LengthType, Games.PlayersTo, Games.Control
FROM Years INNER JOIN (Programmers INNER JOIN (Musicians INNER JOIN (Languages INNER JOIN (Crackers INNER JOIN Games ON Crackers.CR_Id = Games.CR_Id) ON Languages.LA_Id = Games.LA_Id) ON Musicians.MU_Id = Games.MU_Id) ON Programmers.PR_Id = Games.PR_Id) ON Years.YE_Id = Games.YE_Id
ORDER BY Games.Name;

Save it, close it.



Create a new query called "xboxgenres".  Create it directly in Design View mode
because we're just going to enter in straight SQL to construct the query. Go
to SQL View and enter the following SQL:

SELECT DISTINCTROW Genres.GE_Id, [ParentGenre] & "-" & [Genre] AS Expr1
FROM PGenres INNER JOIN Genres ON PGenres.PG_Id = Genres.PG_Id
ORDER BY [ParentGenre] & "-" & [Genre];

Save it, close it.



Create a new query called "xboxpublishers".  Create it directly in Design View mode
because we're just going to enter in straight SQL to construct the query. Go
to SQL View and enter the following SQL:

SELECT Publishers.PU_Id, Publishers.Publisher
FROM Publishers
ORDER BY Publishers.Publisher;

Save it, close it.


Left click on the xboxgames query, File -> Save As/Export
To an External File or Database
Navigate to where the genres.awk, publishers.awk, games.awk, makedat.bat files are located.
Enter xboxgames as the File name and 
Save as Type : Text Files
Choose Delimited, Next
Delimiter : Other : |
Text Qualifier : {none}
Next, Finish

Left click on the xboxgenres query, File -> Save As/Export
To an External File or Database
Navigate to where the genres.awk, publishers.awk, games.awk, makedat.bat files are located.
Enter xboxgenres as the File name and 
Save as Type : Text Files
Choose Delimited, Next
Delimiter : Other : |
Text Qualifier : {none}
Next, Finish

Left click on the xboxpublishers query, File -> Save As/Export
To an External File or Database
Navigate to where the genres.awk, publishers.awk, games.awk, makedat.bat files are located.
Enter xboxpublishers as the File name and 
Save as Type : Text Files
Choose Delimited, Next
Delimiter : Other : |
Text Qualifier : {none}
Next, Finish

You should now have the following files in the same directory as games.awk, genres.awk, publishers.awk,
and makedat.bat:

xboxgames.txt
xboxgenres.txt
xboxpublishers.txt

If that's the case, then run the makedat.bat file.

After it finishes running, you should now have new games.dat, genres.dat and publishers.dat files.
Overwrite the old DAT files with these new DAT files and use the new games.dat file when
running the gb64_xboxrename utility.

