library Project1;{ Important note about DLL memory management: ShareMem must be the
first unit in your library's USES clause AND your project's (select
Project-View Source) USES clause if your DLL exports any procedures or
functions that pass strings as parameters or function results. This
applies to all strings passed to and from your DLL--even those that
are nested in records and classes. ShareMem is the interface unit to
the BORLNDMM.DLL shared memory manager, which must be deployed along
with your DLL. To avoid using BORLNDMM.DLL, pass string information
using PChar or ShortString parameters. }uses
SysUtils,
Classes,adodb;{$R *.res}
function conndb(pw,user,db,computer:string):boolean;stdcall;
var connection:tadoconnection;
connstr:string;
begin
try
connection:=tadoconnection.Create(self);//---------------------提示此处未定义
connstr:= 'Provider=SQLOLEDB.1;Password='+pw+';Persist Security Info=True;User ID='+user+';Initial Catalog='+db+';Data Source='+computer;
connection.ConnectionString:= connstr;
connection.LoginPrompt:=false;
connection.Connected:=true;
result:=true;
except
result:=false;
end;
end;
exports conndb;
begin
end.编译时提示未定义"SELF"
请问:
1,可以在DLL里用CREATE来创建控件的吗?
2,如果可以的话,怎解决上面的未定义的问题?
3,SELF的作用主要是什么.
first unit in your library's USES clause AND your project's (select
Project-View Source) USES clause if your DLL exports any procedures or
functions that pass strings as parameters or function results. This
applies to all strings passed to and from your DLL--even those that
are nested in records and classes. ShareMem is the interface unit to
the BORLNDMM.DLL shared memory manager, which must be deployed along
with your DLL. To avoid using BORLNDMM.DLL, pass string information
using PChar or ShortString parameters. }uses
SysUtils,
Classes,adodb;{$R *.res}
function conndb(pw,user,db,computer:string):boolean;stdcall;
var connection:tadoconnection;
connstr:string;
begin
try
connection:=tadoconnection.Create(self);//---------------------提示此处未定义
connstr:= 'Provider=SQLOLEDB.1;Password='+pw+';Persist Security Info=True;User ID='+user+';Initial Catalog='+db+';Data Source='+computer;
connection.ConnectionString:= connstr;
connection.LoginPrompt:=false;
connection.Connected:=true;
result:=true;
except
result:=false;
end;
end;
exports conndb;
begin
end.编译时提示未定义"SELF"
请问:
1,可以在DLL里用CREATE来创建控件的吗?
2,如果可以的话,怎解决上面的未定义的问题?
3,SELF的作用主要是什么.
解决方案 »
- Delphi WebBrowser如何模拟网页内嵌的一个子页面按钮点击
- tcpclinet和tcpserver的sendbuf,receivebuf问题
- 今天又没去上班……
- 高手帮忙!!数据库操作
- 局域网问题!
- 要怎么做可以使WAV的播放速度可以控制呢??
- dephi6.0的基本问题
- 为什么总提示我插入A盘呢,我是不是改了DELPHI系统的什么参数了呢
- 请问怎样可以得取屏幕布的大小?
- 窗体上有n个Edit,如何通过消息处理的方法实现下面的效果,单击某一Edit,使它的背景色变为黄色?
- 在水晶报表中显示字符串出现的奇怪问题。汉字怎么为空格(在线急)!!!!!!!!
- 基本问题:如何类型转换 父类转换成子类?
通过,但不怎明白,可以解释一下吗?