问一个vb从文件读数据插入数据库的效率问题,郁闷ing,请大家给我点意见 我做的程序是从文件读数据,然后插入到数据库中,刚调好程序时运行还是很快的,几百条数据马上就插入成功了。但是现在一执行就死掉了,数据库中能插入一些数据但很慢。不明白什么原因。没修改什么,只是有单条数据有问题,调试过很多次。我怀疑是立即窗口总启动的原因。但关掉也不行,谁遇到过这个问题阿,帮忙看看问题在哪里。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 太长了阿,只能贴sql语句了strsql = "insert into tb_thesis(serial_number,author,author_spell,id,college,dept,major,answer_date,degree_level,tutor1_name,tutor1_name_spell,tutor1_dept,tutor2_name,tutor2_name_spell,tutor2_dept,secret_level,title,title_spell,equ_title,keyword1,keyword2,keyword3,keyword4,keyword5," strsql=strsql& "abs_cn,abs_fore_lang,abs_fore,page_no,doc_height,ref_doc_amount,ill_amount,table_amount,classfication_no,classfication_no2,file_path,catalog_sign,lib_index) values('" strsql = strsql & Trim(serial_number) & "','" & Trim(author) & "','" & Trim(author_spell) & "','" & Trim(id) & "','" & Trim(college) & "','" & Trim(dept) & "','" & Trim(major) & "','" & Format(year & "/" & month & "/" & day, "YYYY-MM-DD") & "','" & Trim(degree_level) & "','" & Trim(tutor1_name) & "','" & Trim(tutor1_name_spell) & "','" strsql = strsql & Trim(tutor1_dept) & "','" & Trim(tutor2_name) & "','" & Trim(tutor2_name_spell) & "','" & Trim(tutor2_dept) & "','" & Trim(secret_level) & "','" & Trim(Replace(title, "'", "''")) & "','" & Trim(Replace(title_spell, "'", "''")) & "','" & Trim(Replace(equ_title, "'", "''")) & "','" strsql = strsql & Trim(keyword1) & "','" & Trim(keyword2) & "','" & Trim(keyword3) & "','" & Trim(keyword4) & "','" & Trim(keyword5) & "','" & Trim(Replace(abs_cn, "'", "''")) & "','" & Trim(abs_fore_lang) & "','" strsql = strsql & Trim(Replace(abs_fore, "'", "''")) & "'," & page_no & "," & doc_height & "," & ref_doc_amount & "," & ill_amount & "," & table_amount & ",'" & classfication_no & "','" & classfication_no2 & "','" & Left(answer_date, 4) & id & "','" & "1" & "','" & Trim(lib_index) & "')" 'MsgBox (strsql) cnn.Execute (strsql)语句长了点,而且每个字段数据得到都要进行小循还。但刚调试好时很快的,不会是立即窗口的原因吧? 你的源文件是什么格式?如果是数据库引擎支持的内部数据库格式(TXT、Excel),可以直接使用Insert into tb_thesis select * from tablename ... 我得源文件是图书馆专用的marc格式,得一条一条按地址读出来得 急~~~~关于查询的小问题。。。 print 大家帮帮忙,怎样使用shell打开xxx.chm文件!在线等 请问去哪里能载到一份完整的Windows API? 关于ADO访问pbd文件!!!(很急) 请问高手:关于ADO+SQL里建立临时表,在结果中进行搜索的问题!! 有关activereport报表问题!实现动态报表打印。 Label2 = Label1 有没有错误? 请教高手指点关于Audiere高层音频库的迷津 葡萄在吗?他是一个很热心的人,希望能得到他的oicq和e-mail 怎样使用datagrid和adodata控件来操作数据库 关于动态文件
strsql = "insert into tb_thesis(serial_number,author,author_spell,id,college,dept,major,answer_date,degree_level,tutor1_name,tutor1_name_spell,tutor1_dept,tutor2_name,tutor2_name_spell,tutor2_dept,secret_level,title,title_spell,equ_title,keyword1,keyword2,keyword3,keyword4,keyword5,"
strsql=strsql& "abs_cn,abs_fore_lang,abs_fore,page_no,doc_height,ref_doc_amount,ill_amount,table_amount,classfication_no,classfication_no2,file_path,catalog_sign,lib_index) values('"
strsql = strsql & Trim(serial_number) & "','" & Trim(author) & "','" & Trim(author_spell) & "','" & Trim(id) & "','" & Trim(college) & "','" & Trim(dept) & "','" & Trim(major) & "','" & Format(year & "/" & month & "/" & day, "YYYY-MM-DD") & "','" & Trim(degree_level) & "','" & Trim(tutor1_name) & "','" & Trim(tutor1_name_spell) & "','"
strsql = strsql & Trim(tutor1_dept) & "','" & Trim(tutor2_name) & "','" & Trim(tutor2_name_spell) & "','" & Trim(tutor2_dept) & "','" & Trim(secret_level) & "','" & Trim(Replace(title, "'", "''")) & "','" & Trim(Replace(title_spell, "'", "''")) & "','" & Trim(Replace(equ_title, "'", "''")) & "','"
strsql = strsql & Trim(keyword1) & "','" & Trim(keyword2) & "','" & Trim(keyword3) & "','" & Trim(keyword4) & "','" & Trim(keyword5) & "','" & Trim(Replace(abs_cn, "'", "''")) & "','" & Trim(abs_fore_lang) & "','"
strsql = strsql & Trim(Replace(abs_fore, "'", "''")) & "'," & page_no & "," & doc_height & "," & ref_doc_amount & "," & ill_amount & "," & table_amount & ",'" & classfication_no & "','" & classfication_no2 & "','" & Left(answer_date, 4) & id & "','" & "1" & "','" & Trim(lib_index) & "')"
'MsgBox (strsql)
cnn.Execute (strsql)
语句长了点,而且每个字段数据得到都要进行小循还。但刚调试好时很快的,不会是立即窗口的原因吧?
Insert into tb_thesis select * from tablename ...