L
littlefish
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TForm1.Button2Click(Sender: TObject);
var
LS:TStringList;
begin
LS:=TStringList.Create;
Session.GetAliasNames(LS);
if LS.IndexOf('hy')=-1 then
begin
注意这句,数据驱动是FoxPro的,但在hy下建的表却是Paradox的。
Session.AddStandardAlias('hy',S,'FoxPro');
Session.SaveConfigFile;
end
LS.Clear;
Session.GetTableNames('hy',TabName,false,false,LS);
if LS.IndexOf(TabName)=-1 then
begin
MyCreateTable;
end
else
begin
MyDropTable;
MyCreateTable;
end;
end;
procedure TForm1.MyCreateTable;
var
SqlStr:string;
begin
SqlStr:='';
SqlStr:='Create Table '+TabName+' (NoID numeric(8,2))';
Query1.SQL.Clear;
Query1.SQL.Add(SqlStr);
Query1.ExecSQL;
end;
procedure TForm1.MyDropTable;
var
SqlStr:string;
begin
SqlStr:='';
SqlStr:='Drop Table '+TabName;
Query1.SQL.Clear;
Query1.SQL.Add(SqlStr);
Query1.ExecSQL;
end;
建出来的表是Paradox的。FoxPro的驱动都有。我改成dBase的也一样。
另外 Create Table '+TempTabName+' (NoID numeric(8,2)) 定NoID为主键的语法怎么写?
var
LS:TStringList;
begin
LS:=TStringList.Create;
Session.GetAliasNames(LS);
if LS.IndexOf('hy')=-1 then
begin
注意这句,数据驱动是FoxPro的,但在hy下建的表却是Paradox的。
Session.AddStandardAlias('hy',S,'FoxPro');
Session.SaveConfigFile;
end
LS.Clear;
Session.GetTableNames('hy',TabName,false,false,LS);
if LS.IndexOf(TabName)=-1 then
begin
MyCreateTable;
end
else
begin
MyDropTable;
MyCreateTable;
end;
end;
procedure TForm1.MyCreateTable;
var
SqlStr:string;
begin
SqlStr:='';
SqlStr:='Create Table '+TabName+' (NoID numeric(8,2))';
Query1.SQL.Clear;
Query1.SQL.Add(SqlStr);
Query1.ExecSQL;
end;
procedure TForm1.MyDropTable;
var
SqlStr:string;
begin
SqlStr:='';
SqlStr:='Drop Table '+TabName;
Query1.SQL.Clear;
Query1.SQL.Add(SqlStr);
Query1.ExecSQL;
end;
建出来的表是Paradox的。FoxPro的驱动都有。我改成dBase的也一样。
另外 Create Table '+TempTabName+' (NoID numeric(8,2)) 定NoID为主键的语法怎么写?