1.我写的动态创建adoconnection的代码如下:
var
adoconn:Tadoconnection;
begin
adoconn:=TadoConnection.Create(self);
adoconn.ConnectionString:='Provider=Microsoft.Jet.OLEDB.4.0;Data Source=H:\Delphi\delphi\'#23398#29983 +
#20449#24687#31649#29702#31995#32479'\GradeManage.mdb;Persist Security Info=False';
adoconn.Provider:='Microsoft.Jet.OLEDB.4.0';
end;
是不是有错误?错在哪里了?
2.Button能不能动态创建?
以下是我写的动态创建button,编译没错误,但却不能正常显示
var
bt:Tbutton;
begin
bt:=Tbutton.Create(self);
bt.Left:=288;
bt.Top:=48;
bt.Width:=75;
bt.Height:=25;
bt.Caption:='bt';
bt.TabOrder:=3;
bt.Visible:=true;
end;
3.db是paradox数据库吧?用ado连接要用哪个驱动?
var
adoconn:Tadoconnection;
begin
adoconn:=TadoConnection.Create(self);
adoconn.ConnectionString:='Provider=Microsoft.Jet.OLEDB.4.0;Data Source=H:\Delphi\delphi\'#23398#29983 +
#20449#24687#31649#29702#31995#32479'\GradeManage.mdb;Persist Security Info=False';
adoconn.Provider:='Microsoft.Jet.OLEDB.4.0';
end;
是不是有错误?错在哪里了?
2.Button能不能动态创建?
以下是我写的动态创建button,编译没错误,但却不能正常显示
var
bt:Tbutton;
begin
bt:=Tbutton.Create(self);
bt.Left:=288;
bt.Top:=48;
bt.Width:=75;
bt.Height:=25;
bt.Caption:='bt';
bt.TabOrder:=3;
bt.Visible:=true;
end;
3.db是paradox数据库吧?用ado连接要用哪个驱动?
解决方案 »
- Msxml2.XMLHTTP如何使用代理去访问
- 如何合并两个程序,让一个程序运行完毕后再运行另一个程序!
- 如何改变MEMO控件中的某个字符颜色而不是整个MEMO的颜色
- 我在win98中使用命令scm.exe -Action 6 -Silent 1 -Service mssqlserver无法停止sqlservr,请大家指点错在哪里?谢谢!
- 代码中两处使用Tstrings类同一实例的add方法如果不在一个过程中是不是第二处会自动指向下一行?
- ★★★我的程序运行不了,请帮忙看看好吗?★★★
- 如何在程序中声明一个函数及如何调用?(急)
- 有谁清楚虚拟光驱技术能指导我一下吗?
- 修改操作系统的日期格式
- 紧急:请问在三层中对BLOB字段的处理?
- 怎么安装window服务!
- 查询问题
bt.parent:=self;就可以显示出来了
2. 加 bt.parent:=self; 可以显示。注意动态创建的一般都要手动free掉。
3. access的数据库为mdb格式 驱动为Microsoft.Jet.OLEDB.4.0已可
问的是db 不是问mdb~~
去掉还是不行,提示"磁盘或者网络错误"
var
s:string;
begin
ADOTable1.Active :=False;
s:='E:\Application\website\WEB\mdbdata\data.mdb;';
ADOTable1.ConnectionString :='Microsoft.Jet.OLEDB.4.0;Data Source='+s+'Persist Security Info=False';
ADOTable1.Active :=true;
end;
var
s:string;
begin
ADOTable1.Active :=False;
s:='E:\Application\website\WEB\mdbdata\data.mdb';
ADOTable1.ConnectionString :='Provider=Microsoft.Jet.OLEDB.4.0;Data Source='+s+';Persist Security Info=False';
ADOTable1.TableName :='Book';//表的名稱
ADOTable1.Active :=True;
end;