星期一, 三月 28, 2005
星期五, 三月 25, 2005
Register new URL type with Delphi
// You could access your program like this: money://...
// But don't use money://, it is registered by Microsoft Money.
//
const
URL_TYPE = 'spec';
var
Reg: TRegistry;
Handler: String;
begin
//
Reg := TRegistry.Create;
Reg.RootKey := HKEY_CLASSES_ROOT;
try
Reg.OpenKey(URL_TYPE +'\shell\open\command', True);
Handler := ''; // your program location.
// Do Register here.
Reg.WriteString('', Handler);
Reg.CloseKey;
Reg.OpenKey(URL_TYPE, True);
Reg.WriteString('', 'url: Spec.....');
Reg.WriteInteger('EditFlags', 2);
Reg.WriteString('URL Protocol', '');
Reg.CloseKey;
finally
Reg.Free;
end;
Clear COM reference with quit from application using Delphi
ComServ;
type
_TComServerHack = class(TComServer)
end;
while (_TComServerHack (ComServer)).ObjectCount > 0 do
_TComServerHack (ComServer).CountObject(False);
CanClose := True;
Direct your domain to seperate path using PHP
If you have several domain and have only one virtual space on a server like me, try this:
$site_matrix = array(
"$site1" => "$path1",
"$site2" => "$path2"
);
$def_pg = "$def_path";
$server = $_SERVER["HTTP_HOST"];
$pg = $site_matrix[$server];
if($pg == "") $pg = $def_pg;
header("Location: $pg");
Let's run report explorer with Oracle(ADO)
it need to modify some files of source if you want to user explorer with
Oracle(ADO).
1. Tables. You need to create sequences and triggers after you created the
tables.
CREATE TABLE "FOLDER" (
"FOLDERID" NUMBER(10) NOT NULL,
"NAME" VARCHAR2(60) NOT NULL,
"PARENTID" NUMBER(10) NOT NULL);
CREATE SEQUENCE "RBFOLDER" INCREMENT BY 1;
CREATE OR REPLACE TRIGGER "GEN_FOLDERID" BEFORE
INSERT ON "FOLDER"
FOR EACH ROW WHEN(NEW.FOLDERID IS NULL) BEGIN
SELECT "RBFOLDER".NEXTVAL INTO :NEW.FOLDERID FROM DUAL;
END;
CREATE TABLE "ITEM"(
"ITEMID" NUMBER(10) NOT NULL,
"SIZE0" NUMBER(10),
"FOLDERID" NUMBER(10) NOT NULL,
"NAME" VARCHAR2(60) NOT NULL,
"ITEMTYPE" NUMBER(10),
"MODIFIED" DATE,
"DELETED" CHAR(1) DEFAULT 'F',
"TEMPLATE" LONG RAW);
CREATE SEQUENCE "RBITEM" INCREMENT BY 1;
CREATE OR REPLACE TRIGGER "GEN_ITEMID" BEFORE
INSERT ON "ITEM"
FOR EACH ROW WHEN(NEW.ITEMID IS NULL) BEGIN
SELECT "RBITEM".NEXTVAL INTO :NEW.ITEMID FROM DUAL;
END;
CREATE TABLE "TABLE" (
"TABLENAME" VARCHAR2(60) NOT NULL,
"TABLEALIAS" VARCHAR2(60) NOT NULL);
CREATE TABLE "FIELD" (
"TABLENAME" VARCHAR2(60) NOT NULL,
"FIELDNAME" VARCHAR2(60) NOT NULL,
"FIELDALIAS" VARCHAR2(60) NOT NULL,
"SELECTABLE" CHAR(1) DEFAULT 'T',
"SEARCHABLE" CHAR(1) DEFAULT 'T',
"SORTABLE" CHAR(1) DEFAULT 'T',
"DATATYPE" VARCHAR2(60),
"AUTOSEARCH" CHAR(1) DEFAULT 'T',
"MANDATORY" CHAR(1) DEFAULT 'F');
2. Modify the source.
These files need to be modified:
daAdo.pas Oracle do not support Schema in ADO well.
ppRptExp.pas same reason: need to refresh the dataset after insert the
folder or report.
ppTmplat.pas /
You could download the modified source at
http://www.miracube.com/downloads/rb7ora-patch-0.1.rar.
First post on digital-metaphors.com's newsgroup.


