BDE 是宝兰公司的数据库引擎,BDE给我们提供了和数据库交流的接口,它成功的把应用程序接口和连接数据库部分分开,就方变了程序的移植。
ADO 是微软公司提供的用来访问数据库的接口,通过OLE DB技术来访问数据库。
无所谓谁好谁坏。用谁视具体情况定.
ADO 是微软公司提供的用来访问数据库的接口,通过OLE DB技术来访问数据库。
无所谓谁好谁坏。用谁视具体情况定.
解决方案 »
- 急!!!怎么创建能当容器用的ActiveX控件啊
- 求教关于自定义组件的问题
- delphi7中TDBEdit控件在win7上出现的问题!
- delphi excelapp 操作 已经存在名为 resume.xlw的文件。您希望将该文件替换掉吗
- 急啊,idftp问题
- 挑战性问题:(版主、高手请进)Object Pascal中可以把一类声明为另一个类的友元类?同时两个类不在同一个Unit中;
- ×××××××谁有WWQUERY.PAS文件×××××××
- 怎样给手机发短信息?
- 哪里有visio2000的教程下载
- Borland的兴衰史--关于Delphi等IDE发展前景的讨论.
- 这样的进度条怎么用?
- 被FORMAT的硬盘能不能在 DOS下恢复?
都是bde已经不会有新版本了,ado可是才开始!
有一点,bde对oracle支持比较好,其他的用ado吧!
不需要安装客户端,是基于COM的,而且性能也要优于BDE
function TfrmMain.LoadListData(DeptID: Integer): Boolean;
var
rsTmp:TADODataSet;
i,j:Integer;
AItem:TListItem;
ACol:TListColumn;
AData:PInteger;
strSQL:String;
Begin
Result:=True;
Screen.Cursor:=crHourGlass; rsTmp:=TADODataSet.Create(frmMain);
rsTmp.CursorLocation:=clUseClient;
rsTmp.CursorType:=ctKeyset;
rsTmp.Connection:=gcnOracle;
rsTmp.CommandType:=cmdText; if DeptId=0 then
strSQL:='Select A.*,B.DeptID From Mans A,Depts B Where B.ManID=A.ID And B.Default=1'
else
strSQL:='Select A.*,B.DeptID From Mans A,Depts B Where B.ManID=A.ID And B.DeptID='+Inttostr(DeptID);
rsTmp.CommandText:=strSQL; try
try
rsTmp.Open; lvw.Items.BeginUpdate;
lvw.Items.Clear;
if lvw.Columns.Count=0 then Begin
lvw.Columns.BeginUpdate;
lvw.Columns.Clear;
for i:=0 to rsTmp.FieldCount-1 do Begin
ACol:=lvw.Columns.Add;
ACol.Width:=80;
ACol.Caption:=rsTmp.Fields[i].FieldName;{注意不是Name}
end;
lvw.Columns.EndUpdate;
end; for i:=0 to rsTmp.RecordCount-1 do Begin
AItem:=lvw.Items.Add;
AItem.ImageIndex:=0;
AItem.Caption:=rsTmp.Fields[0].AsString;
New(AData);
AData^:=rsTmp.FieldByName('ID').AsInteger;
AItem.Data:=AData; for j:=1 to rsTmp.FieldCount-1 do
AItem.SubItems.Add(rsTmp.Fields[j].AsString); rsTmp.Next;
end;
finally
if rsTmp.Active then rsTmp.Close;
rsTmp.Free;
lvw.Items.EndUpdate;
Screen.Cursor:=crDefault;
end;
except
ErrCenter(frmMain,gcnOracle,False);
Result:=False;
end;
End;
function TfrmMain.LoadListData(DeptID: Integer): Boolean;
var
rsTmp:TADODataSet;
i,j:Integer;
AItem:TListItem;
ACol:TListColumn;
AData:PInteger;
strSQL:String;
Begin
Result:=True;
Screen.Cursor:=crHourGlass; rsTmp:=TADODataSet.Create(frmMain);
rsTmp.CursorLocation:=clUseClient;
rsTmp.CursorType:=ctKeyset;
rsTmp.Connection:=gcnOracle;
rsTmp.CommandType:=cmdText;
if DeptId=0 then
strSQL:='Select A.*,B.DeptID From ManTab A,DeptMan B Where B.ManID=A.ID And B.Default=1'
else
strSQL:='Select A.*,B.DeptID From ManTab A,DeptMan B Where B.ManID=A.ID And B.DeptID='+Inttostr(DeptID);
rsTmp.CommandText:=strSQL; try
try
rsTmp.Open; lvw.Items.BeginUpdate;
lvw.Items.Clear; if lvw.Columns.Count=0 then Begin
lvw.Columns.BeginUpdate;
lvw.Columns.Clear;
for i:=0 to rsTmp.FieldCount-1 do Begin
ACol:=lvw.Columns.Add;
ACol.Width:=80;
ACol.Caption:=rsTmp.Fields[i].FieldName;{注意不是Name}
end;
lvw.Columns.EndUpdate;
end; for i:=0 to rsTmp.RecordCount-1 do Begin
AItem:=lvw.Items.Add;
AItem.ImageIndex:=0;
AItem.Caption:=rsTmp.Fields[0].AsString; New(AData);
AData^:=rsTmp.FieldByName('ID').AsInteger;
AItem.Data:=AData; for j:=1 to rsTmp.FieldCount-1 do
AItem.SubItems.Add(rsTmp.Fields[j].AsString); rsTmp.Next;
end;
finally
if rsTmp.Active then rsTmp.Close;
rsTmp.Free;
lvw.Items.EndUpdate;
Screen.Cursor:=crDefault;
end;
except
ErrCenter(frmMain,gcnOracle,False);
Result:=False;
end;
End;
我的理解
BDE成熟,你也可以说它老
ADO年轻,你也可以说它不完善