<% @ Page language = "Delphi"%>
<% @ Import namespace = "system.data"%>
<% @ Import namespace = "system.data.oledb"%>
Procedure Button1Click (Sender: System.
Object; E: Eventargs;
Var myconnection: OLEDBCONNECTION;
DBReader: OledbDataReader;
CMD: OLEDBCommand;
ABC:
String;
OUTVAL:
String;
INTVAL: Longint;
Begin abc: = 'provider = microsoft.jet.Oledb.4.0; password =; data source = c: /mydb.mdb';
MyConnection: = OLEDBConnection.create (ABC);
MyConnection.open;
cmd: = myconnection.createCommand;
cmd.commandtext: = 'SELECT * from Table1';
DBReader: = cmd.executeReader;
While (DBReader.read)
Do Begin Intval: = DBReader.getInt32 (0);
OUTVAL: = DBReader.getstring (1);
END;
Label1.Text: = INTTOSTR (INTVAL);
END;
Procedure Button2Click (Sender: System.
Object; E: Eventargs;
VAR Connstr:
String;
Commtxt:
String;
MyConnection: OLEDBCONNECTION;
ABC:
String;
CmdText:
String;
CMD: OLEDBCommand;
Begin connStr: = 'provider = microsoft.jet.Oledb.4.0; password =; data source = c: /mydb.mdb';
Commtxt: = 'SELECT Andy As [first name], chapman as [last name] from table1'
ABC: = 'provider = microsoft.jet.Oledb.4.0; password =; data source = c: /mydb.mdb';
MyConnection: = OLEDBConnection.create (ABC);
CMD: = OLEDBCommand.create (Commtxt, MyConnection);
MyConnection.open;
DataGrid1.datasource: = cmd.executeReader (Commandbehavior.CloseConnection);
DataGrid1.databind ();
END;
script>
hEAD>
h2>