after reading at matlus.com how to make an aspobject
i wanted to do that with ibo
{and it's really fast}
u don't need any ado-ole-odbc-bde stuff
first need to create an (h)activeX Library
then go an do an Active Server Object
of course u 'll need an dbmodule to put the database
and a query add this dbmodule to the project
and put it in uses clause of the main.pas unit
main.pas is the implementation of our object
in typelybrary have aded some methods and propretys
the most important ones and propretys
the most important ones are connect
and sqlquery
- connect have 4 parameters dbName,user,passwd,dialect
the implementation is:
procedure Tibdataset.connect(const dbName, user, passwd: WideString;
dialect: Shortint);
var text: string;
begin
with dm do
begin
db.DatabaseName := string(dbName);
db.Username := string(user);
db.Password := string(passwd);
db.SQLDialect:=dialect;
try
db.Connect;
// text := 'connected Ok<br>';
except
text := '<FONT face=verdana size=1>There was an error connecting</FONT>';
|
procedure Tibdataset.sqlquery(const sqlstring: WideString);
var text: string;
begin
with dmdm do
begin
qMain.Close;
qMain.SQL.Clear;
qMain.SQL.Add(string(sqlstring));
try
qMain.Open;
// text := 'Open';
except
text := '<FONT face=verdana size=1>Please execute the query first</FONT>';
end;
end="#00FFFF">;
response.Write(text);
end;
|
function Tibdataset.Get_fieldname(const fieldname: WideString):00FFFF">: OleVariant; begin result := dm.qMain.FieldByName(string(fieldname)).AsVariant end; |
|
put the asp in the wwwroot
and register the dll to work with asp engine
then go and try the asp