public String GDFG_InsertTable(GDFG_PM pm, String tableName = "GDFG") { String ret = ""; /********消除非法字符***********/ SemiConvert(pm); if (GetGDFGCount(pm.fgmc, tableName) > 0) { return "本地库中存在重复记录."; } String iSql = "insert into [" + tableName + "] ([分类编码], [索引编码], [文件名], [法规文号], [法规名称], [发布单位], [发布日期], [实施日期], [时效], [失效日期], [开本], [页数], [专业分类], [全文检查], [开放], [备注],[登录人],[更新日期] ) values (" + "'" + pm.flbm + "'," + "'" + pm.sybm + "'," + "'" + pm.wjm + "'," + "'" + pm.fgwh + "'," + "'" + pm.fgmc + "'," + "'" + pm.fbdw + "'," + "'" + pm.fbrq + "'," + DateString(pm.ssrq) + "," + "'" + pm.sx + "'," + DateString(pm.sxrq) + "," + "'" + pm.kb + "'," + "'" + pm.ys + "'," + "'" + pm.zyfl + "'," + pm.qwjc + "," + pm.kf + "," + "'" + pm.bz + "'," + "'" + pm.dlr + "'," + "'" + pm.gxrq + "')"; ret = mdbDao.DoMdbPureUpdate(iSql); return ret; }
public static void DoInit(String dst, String src, String mdbFile) { srcDir = src; dstDir = dst; NO = 0; totalCount = 0; succCount = failCount = repCount = 0; bw = BuildWord.InstanceObject(); gdfg = new GDFG_PM(); ht = new Hashtable(); gdfgMDB = new GDFG_MDB(mdbFile); gdfgSQL = new GDFG_SQL(); string ret = gdfgMDB.GDFG_CreateTable(); int cnt = GetTotalCount(srcDir); Logger.WriteLog("创建MDB表:" + ret); Logger.WriteLog("存在TXT文件数:" + cnt.ToString()); }
private void SemiConvert(GDFG_PM pm) { pm.fgmc = pm.fgmc.Replace('\'', '"'); pm.fgwh = pm.fgwh.Replace('\'', '"'); pm.fbdw = pm.fbdw.Replace('\'', '"'); pm.bz = pm.bz.Replace('\'', '"'); }
public string InsertGDFG(GDFG_PM pm) { if (GetGDFGCount(pm.fgmc, pm.fbrq, pm.fgwh) > 0) { return "主库中存在相同记录."; } SemiConvert(pm); String iSql = "insert into [GDFG_PM] ([flbm], [sybm], [wjm], [fgwh], [fgmc], [fbdw], [fbrq], [ssrq], [sx], [sxrq], [kb], [ys], [zyfl], [qwjc], [kf], [bz], [dlr],[gxrq]) values (" + "'" + pm.flbm + "'," + "'" + pm.sybm + "'," + "'" + pm.wjm + "'," + "'" + pm.fgwh + "'," + "'" + pm.fgmc + "'," + "'" + pm.fbdw + "'," + "'" + pm.fbrq + "'," + DateString(pm.ssrq) + "," + "'" + pm.sx + "'," + DateString(pm.sxrq) + "," + "'" + pm.kb + "'," + "'" + pm.ys + "'," + "'" + pm.zyfl + "'," + "'" + pm.qwjc + "', '" + pm.kf + "'," + "'" + pm.bz + "'," + "'" + pm.dlr + "'," + "'" + pm.gxrq + "')"; /* 返回 ok 说明插入成功 */ return sqlDao.SqlPureUpdate(iSql); }