就是说把原来的一个表的内容,分成几个表增加到access中?
解决方案 »
- XML文件分割
- ★ 200分求图片识别问题
- 请教SQL视图的问题?急急……
- [求助]编译时,这是什么错误?
- 请问raptor先生 你的msocket控件。
- 初学CORBA方式编程ClientDatabase问题。急!!!
- 大三下学期了,我还不知道我到底要干什么呢。请进来帮帮我!
- 请问哪一位高手编写过分店形式的系统, 像这样的架构....
- 急!!!! 如何解决在一个显示控件中写入大量数据的问题!!
- 天哪,刚学Delphi就碰上问题了,我没分了,但请大家帮帮忙,请问PChar和String如何转换?
- 怎么做一个,要注册才可以用的这么一个程序?
- 如何把WideString的内容copy到PWideChar所指向的缓冲区中?急!!!!
如:
Source为源表
Dest为目标表
SelFieldList为选择的字段
DestTableName 为要在Access中创建的表
当然在调用该过程前还要用一个DataBase与Access数据库建立连接或者是建立别名
然后把Dest的DataBaseName 设置上相应的DataBase。
SelFieldList是选择要导入的字段,这也要准备好
procedure DbfToAccess(Source, Dest: TTable; SelFieldList: TStirngList; destTableName: string);
var
I: Integer;
begin
with Dest do
begin
TableName := DestTableName;
with FieldDefs do
begin
for I := 0 to SelFieldList.Count - 1 do
Add(SelFieldList[I], Source.FieldByName(SelFieldList[I]).FieldName, Source.FieldByName(SelFieldList[I]).DataSize - 1);
end;
CreateTable;
Active := True;
Source.First;
while not Source.Eof do
begin
Append;
for I := 0 to SelFieldList.Count - 1 do
case FieldByName(SelFieldList[I]).DataType of
ftString: FieldByname(SelFieldList[I]).AsString := Source.FieldByName(SelFieldList[I]).AsString;
ftFloat: FieldByName(SelFieldList[I]).AsFloat := Source.FieldByName(SelFieldList[I]).AsFloat;
ftInteger:
....
end;
Source.Next;
end;
Close;
end;
end;