• Civilization 7 has been announced. For more info please check the forum here .

Exporting Microsoft Access Tables into SQL querey

GreatAugustus

Chieftain
Joined
May 16, 2012
Messages
11
Location
England
Microsoft Access 2010 provides a clear, easy to read tables to work with. You can build/create all sorts, from technologies to resources with them. You can export them into XML too.

You need to find the vanilla you want to edit. Once done examine and copy the table columns.
Spoiler :

Heres an example of the new eras in my mod on MSA:
Spoiler :


Here is how to do it for XML:

1. Right click the table you want to export, then click Export -> XML
Spoiler :

2. Deselect the schema file option.
3. Vola! your XML file complete! however, some last minuete changes:
Spoiler :

Delete the second line (<dataroot xmlns:od="urn:schemas-microsoft-com:officedata" generated="2012-05-20T09:14:36">)
<CivExEras>Rename where appropiate. For me I have to change this to "Eras".
<ID>11</ID>
(Insert "<Row>" here)
<Type>ERA: EARLY MODERN ERA</Type>
<Description>TEXT: EARLY MODERN ERA</Description>
<Strategy>TEXT: EARLY MODERN ERA STRATEGY</Strategy>
<ArtPrefix>MODERN</ArtPrefix>
<NoGoodies>0</NoGoodies>
<NoBarbUnits>0</NoBarbUnits>
<NoBarbCities>0</NoBarbCities>
<FirstSoundtrackFirst>0</FirstSoundtrackFirst>
<ResearchAgreementCost>0</ResearchAgreementCost>
<StartingUnitMultiplier>4</StartingUnitMultiplier>
<StartingDefenseUnits>8</StartingDefenseUnits>
<StartingWorkerUnits>4</StartingWorkerUnits>
<StartingExplorerUnits>3</StartingExplorerUnits>
<StartingGold>4000</StartingGold>
<StartingCulture>5000</StartingCulture>
<FreePopulation>4</FreePopulation>
<LaterEraConstructionMod>50</LaterEraConstructionMod>
<StartPercent>100</StartPercent>
<BuildingMatinencePercent>80</BuildingMatinencePercent>
<GrowthPercent>50</GrowthPercent>
<Trainpercent>100</Trainpercent>
<ConstructPercent>100</ConstructPercent>
<CreatePercent>100</CreatePercent>
<ResearchPercent>100</ResearchPercent>
<BuildPercent>100</BuildPercent>
<ImprovementPercent>100</ImprovementPercent>
<GreatPeoplePercent>100</GreatPeoplePercent>
<CulturePercent>100</CulturePercent>
<EventChancePerTurn>10</EventChancePerTurn>
<SoundtrackSpace>0</SoundtrackSpace>
<CityBombardEffectTag>NULL</CityBombardEffectTag>
<AudioUnitVictoryScript>NULL</AudioUnitVictoryScript>
<AudioUnitDefeatScript>NULL</AudioUnitDefeatScript>
(Insert "</Row>" here)
</CivExEras>


Now for SQL. The process is longer. It's up to you whenever it's worth it:

1. Download and install SQLite Database Browser at here.
2. Export the table in MSA into an ".txt" file.
3. don't check any boxes.
4. Then a window like this will pop up:
Spoiler :
Keep the settings.
5. Set to delimited: set the seperation - must be either commas or semicolons.
6. Include field names on first row checked
7. open SQLite Database Browser
8. Click new database (new file icon)
9. Save
10. click import -> Table from CSV File
11. Extract field names from first line checked
12. Export -> Database to SQL
Vola!

- XML
- SQL
 
That's an interesting way of modding, thanks for your detailed explanation.

One correction though - the last screenshot doesn't look like SQL...
 
Top Bottom