fixed up addtablesql and started working on addrecordsql