问题,数据库中的二进制文件导出。。第一步,ACCESS数据库中的二进制导出,word文档。第二步,获取导出的word文档,然后过滤一些特殊字符,变成txt存文本。第三步,连接到mysql数据库,并且插入到对应的字段。我弄2天了。还是没有解决,请高手帮我做一下,以前没接触过D,最好代码能全一些。
不够再加分。。在线等
不够再加分。。在线等
解决方案 »
- 请问如何把DBLookupComboBox的选项在FORM关闭时去掉
- 【地址报错问题】
- 关于DELPHI的安装问题?
- 请问如何在Delphi中如何调用SQLServer中的系统存储过程!
- ?报表里QRDBText面的Mask属性能否把时间(2002-2-3 8:03)格式化为8:03!!!
- 如何判断一个应用服务器是否是一个合法的服务器?
- 谁有SoftIce最新版(for Win2000/XP),给我发一个!!!!!!!
- 关于数据表的定位和修改问题?????
- 要从远程访问winnt,是不是一定要装ras服务, 我用的是宽带,adsl上网,怎样设置才可以
- 应用程序服务器用什么方式比较好?
- FastReport报表中上下标题
- 电焊工艺规范
打开WORD文档var wordapp,doc:olevariant;
I,iRow,iCol,IDHAO:INTEGER;
NEWITEM:TLISTITEM;
recostr,guidang,addgd,gdfile,filecopy:string;
begin
IF OpenDialog1.Execute THEN BEGIN
Application.CreateForm(Tfind, find);
find.Show;
find.Update;
LISTVIEW1.Clear ;
IDHAO:=0;
wordapp:=createoleobject('Word.application');
doc:=wordapp.Documents.Open(FileName:=OpenDialog1.FileName);
For i := 1 To doc.Tables.Count do
For iRow := 2 To doc.Tables.Item(i).Rows.Count do begin
NEWITEM:=LISTVIEW1.Items.Add ;
IF LISTVIEW1.Items.Item[0].Caption='' THEN
NEWITEM.Caption:=INTTOSTR(IDHAO)
ELSE BEGIN
IDHAO:=IDHAO+1;
NEWITEM.Caption:=INTTOSTR(IDHAO);
END;
For icol := 1 To doc.Tables.Item(i).Columns.Count do begin
recostr:=doc.Tables.Item(i).Cell(iRow,icol).Range.Text;
while length(recostr) <> 0 do begin
filecopy:=Copy(recostr,1,Pos('',recostr)-1);
NEWITEM.SubItems.Add(filecopy) ;
delete(recostr,1,Pos('',recostr));
end;
end;
guidang:=doc.Paragraphs.item(2).range.text;
while length(guidang) > 1 do begin
gdfile:=Copy(guidang,1,Pos(chr(13),guidang)-1);
delete(guidang,1,Pos(chr(13),guidang));
end;
gdfile:=gdfile+'-';
addgd:=gdfile;
while length(gdfile)<>0 do begin
guidang:=Copy(gdfile,1,Pos('-',gdfile)-1);
NEWITEM.SubItems.Add(guidang+chr(13)) ;
delete(gdfile,1,Pos('-',gdfile));
end;
end;
wordapp.quit;保存为TXT文件VAR filename: textfile;
I,J:INTEGER;
newfile,zdfile,STR,FILECOPY,RECOSTR:STRING;
begin
IF SaveDialog1.Execute THEN BEGIN
str := SaveDialog1.FileName;
assignfile(FileName, str);
if FileExists(str) then DeleteFile(SaveDialog1.FileName);
ReWrite(filename);
FOR I:=0 TO LISTVIEW1.Items.Count-1 DO BEGIN
for j:=0 to listview1.Items[i].SubItems.Count -1 do begin
recostr:=listview1.Items[i].SubItems.Strings[j];
while length(recostr) <> 0 do begin
filecopy:=Copy(recostr,1,Pos(CHR(13),recostr)-1);
delete(recostr,1,Pos(CHR(13),recostr));
zdfile:=zdfile+filecopy;
end;
newfile:=newfile+zdfile+chr(14);
zdfile:='';
end;
Writeln(FileName, newfile);
newfile:='';
END;
closefile(filename);
APPLICATION.MessageBox('文 本 文 件 保 存 完 毕 !','系统提示',MB_OK+MB_ICONINFORMATION);