2009-12-01 00:41:35
之前安装了oracle 10g,后来为了在C#里面连接oracle,安装了ODAC,之后连接数据库时,填写数据库服务名,总是会出错,连接测试无法通过,不填数据库服务名,倒还可以通过连接测试
今晚终于查到原因了。。。
系统属性那里的环境变量,path这里,oracle的两个默认路径:
d:\oracle\product\10.2.0\db_1\bin;
D:\oracle\product\10.2.0\client_1;
第一个是oracle的客户端,第二个是ODAC的,两个在path的顺序,不能颠倒,比如:
D:\oracle\product\10.2.0\client_1;d:\oracle\product\10.2.0\db_1\bin;
就会出错啦……调整两个的顺序,测试通过
第一次用delphi的ado连接数据库,连接步骤:
控件adoconnection双击,点击build设置就行了,用户输入scott,密码tiger,
再加入adoquery,connection选adoconnection1,sql选项里面写入sql,
加入datasource,dataset为adoquery1,
在adoquery1的sal属性中,加入一条测试用的sql语句,句末不用分号“;”不然执行不了,接着设置adoquery1、adoconnection1的active为true
加入dbgrid,datasource为datasource1,应该就能看见了,这个就是简单的使数据显示出来
......
2009-12-01 00:41:35
之前安装了oracle 10g,后来为了在C#里面连接oracle,安装了ODAC,之后连接数据库时,填写数据库服务名,总是会出错,连接测试无法通过,不填数据库服务名,倒还可以通过连接测试
今晚终于查到原因了。。。
系统属性那里的环境变量,path这里,oracle的两个默认路径:
d:\oracle\product\10.2.0\db_1\bin;
D:\oracle\product\10.2.0\client_1;
第一个是oracle的客户端,第二个是ODAC的,两个在path的顺序,不能颠倒,比如:
D:\oracle\product\10.2.0\client_1;d:\oracle\product\10.2.0\db_1\bin;
就会出错啦……调整两个的顺序,测试通过
第一次用delphi的ado连接数据库,连接步骤:
控件adoconnection双击,点击build设置就行了,用户输入scott,密码tiger,
再加入adoquery,connection选adoconnection1,sql选项里面写入sql,
加入datasource,dataset为adoquery1,
在adoquery1的sal属性中,加入一条测试用的sql语句,句末不用分号“;”不然执行不了,接着设置adoquery1、adoconnection1的active为true
加入dbgrid,datasource为datasource1,应该就能看见了,这个就是简单的使数据显示出来
......
program PureAPIWindow;
uses
SysUtils,
Windows,
Messages;
const
WinClassName = 'DvsClass';
StrOut = 'Davis TextOut';
//窗口回调函数
function MyWinProc(
hWindow: HWND;
aMessage: UINT;
WParam: WPARAM;
LParam: LPARAM): LRESULT; stdcall; export;
var
dc: HDC;
ps: TPaintStruct;
rect: TRect;
begin
MyWinProc := 0;
case aMessage of
WM_PAINT:
begin
dc := BeginPaint(hWindow,ps);
GetClientRect(hWindow,rect);
DrawText(dc,StrOut,Length(StrOut),rect,DT_SINGLELINE or DT_CENTER or DT_VCENTER);
//TextOut(dc,0,0,StrOut,Length(StrOut));
EndPaint(hWindow,ps);
end;
WM_LBUTTONDOWN:
begin
dc := GetDC(hWindow);//GetDC(0);
TextOut(dc,0,0,'Left Button Down',Length('Left Button Down'));
ReleaseDC(hWindow,dc);
//ReleaseDC(0,dc);
end;
WM_CLOSE:
if ID_YES = MessageBox(0,'Are you sure exit ?','Propmt info',MB_YESNO) then
begin
DestroyWi ......
Rem Delete Delphi temporary file
Rem ****************************
@echo Delete Delphi temporary file
@dir/w/s *.~*
@echo 以上为当前目录及子目录临时文件,请按任意键确认删除!
@pause
@for /r . %%a in (.) do @if exist "%%a\*.~*" del "%%a\*.~*"
@echo 删除成功!
@pause
Rem **************************** ......
unit unitMain;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
Button3: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
procedure WMGetMinMaxInfo(var msg: TWMGetMinMaxInfo); message WM_GETMINMAXINFO;
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
var
FullRgn, ClientRgn, ButtonRgn: THandle;
Margin, X, Y: Integer;
begin
Margin := (Width - ClientWidth) div 2;
FullRgn := CreateRectRgn(0, 0, Width, Height);
X := Margin;
Y := Height - ClientHeight - Margin;
ClientRgn := CreateRectRgn(X, Y, X + ClientWidth, Y + ClientHeight);
Com ......
unit unitMain;
interface
uses
Registry, shlobj,
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls;
type
TExtForm = class(TForm)
ledExtension: TLabeledEdit;
ledAssocApp: TLabeledEdit;
GetAssocApp: TButton;
AssocThisButton: TButton;
procedure FormCreate(Sender: TObject);
procedure AssocThisButtonClick(Sender: TObject);
procedure GetAssocAppClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
ExtForm: TExtForm;
implementation
{$R *.dfm}
function GetExeByExtension(sExt : string) : string;
var
sExtDesc:string;
begin
with TRegistry.Create do
begin
try
RootKey:=HKEY_CLASSES_ROOT;
if OpenKeyReadOnly(sExt) then
begin
sExtDesc:=ReadString('') ;
CloseKey;
end;
if sExtDesc <>'' then
begin
if OpenKeyReadOnly(sExtDesc + '\Shell ......
http://www.delphibbs.com/delphibbs/dispq.asp?lid=2420610
目录
===============================================================================
⊙
RTTI 简介
⊙ 类(class) 和 VMT 的关系
⊙ 类(class)、类的类(class of class)、类变量(class
variable) 的关系
⊙ TObject.ClassType 和 TObject.ClassInfo
⊙ is 和 as
运算符的原理
⊙ TTypeInfo – RTTI 信息的结构
⊙ 获取类(class)的属性(property)信息
⊙
获取方法(method)的类型信息
⊙ 获取有序类型(ordinal)、集合(set)类型的 RTTI 信息
⊙ 获取其它数据类型的 RTTI
信息
===============================================================================
本文排版格式为:
正文由窗口自动换行;所有代码以 80
字符为边界;中英文字符以空格符分隔。
(作者保留对本文的所有权利,未经作者同意请勿在在任何公共媒体转载。)
正文
===============================================================================
⊙
RTTI
简介
===============================================================================
RTTI(Run-Time
Type Informat ......