请教access数据库动态生成的问题
//**********************************
//程序功能:创建Access数据库和数据表
//**********************************
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ComObj, ADODB, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
Path: string;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
Path := ExtractFilePath(Application.ExeName);
end;
//数据库创建过程
procedure TForm1.Button1Click(Sender: TObject);
var
CreateAccess: OleVariant;
begin
//如果存在同名文件,则删除之
if FileExists(Path + 'A1.mdb') then
begin
DeleteFile(Path + 'A1.mdb');
end;
CreateAccess := CreateOleObject('ADOX.Catalog');
CreateAccess.Create(
相关问答:
access vba 中怎么取得数组长度?
数组行?
UBound(数组名)
ubound()-lbound()
UBound 函数
返回一个 Long 型数据,其值为指定的数组维可用的最大下标。
语法 ......
我有一个Units表,结构为:
ID UnistsName
UN1 黑龙江东方学院
UN2   ......
VB+Access做的系統,
怎樣把數據庫Access內容導出execl?
现在没东西试,从网上找了段代码你看看
VB code:
Private Sub ExportOneTable()
'EXPORTS TABLE IN ......
string strAdd = "update tb_Note set Note='" + richTextBox1.Text + "' where NoteCode='"+strflag +"'"
都是文本类型的
完全正确。
你不试一下就提高
......