L
liounzhou
Unregistered / Unconfirmed
GUEST, unregistred user!
请问如何用代码实现动态创建一个物理数据库文件如Acess 2000?我用的是Dephi 6
我在网上找到了这段代码,可是报错:找不到可安装的ISAM!请各位帮忙看一下:
function CreateDatabase(mDatabaseName: String;ObjHandle:THandle): Boolean;
var
CreateAccess:OLEVariant;
begin
Result:=False;
try
CreateAccess:=CreateOleObject('ADOX.Catalog');
try
CreateAccess.Create(Format('Provider=Microsoft.Jet.OLEDB.4.0;Data Source=%s%s.mdb',
[ExtractFilePath(Application.ExeName),mDatabaseName]));
finally
CreateAccess:=Unassigned;
end;
except
on e:Exception do Windows.MessageBox(ObjHandle,PChar(e.Message),'´íÎó!',
MB_OK+MB_ICONSTOP);
end;
Result:=True;
end;
我在网上找到了这段代码,可是报错:找不到可安装的ISAM!请各位帮忙看一下:
function CreateDatabase(mDatabaseName: String;ObjHandle:THandle): Boolean;
var
CreateAccess:OLEVariant;
begin
Result:=False;
try
CreateAccess:=CreateOleObject('ADOX.Catalog');
try
CreateAccess.Create(Format('Provider=Microsoft.Jet.OLEDB.4.0;Data Source=%s%s.mdb',
[ExtractFilePath(Application.ExeName),mDatabaseName]));
finally
CreateAccess:=Unassigned;
end;
except
on e:Exception do Windows.MessageBox(ObjHandle,PChar(e.Message),'´íÎó!',
MB_OK+MB_ICONSTOP);
end;
Result:=True;
end;