因为对数据库不懂,所以稍微看了下代码,楼主的代码有些地方还可以再优化一下,像很多地方用INSTR函数,LEFT函数与RIGHT函数获取名称的地方都可以用SPLIT函数来处理。
比如:
tableName = Left(Left(LineText, colon - 1), InStr(1, Left(LineText, colon - 1), " ") - 1) & "_" & Right(Left(LineText, colon - 1), Len(Left(LineText, colon - 1)) - InStr(1, Left(LineText, colon - 1), " "))
可以改为:
tableName = Replace(Split(LineText, ":")(0), " ", "_")
小小建议,供参考。
|