php / ***************************************** only support User name and password database ***************************************************************** MS_ACCESS_CLASS {VAR $ RS, $ conn; function ms_access_class ($ db_name) {$ this-> = ""; $ this-> conn = new com ('adoDb.connection') OR DIE ('server ADO object is not installed) $ This-> conn-> open ("provider = microsoft.jet.Oledb.4.0; data source = $ db_name; persist security info = false");} Function Query ($ query_str) {$ this-> rs = $ this-> conn-> execute ($ query_str);
Function next () {if ($ this-> rs! = ") {$ this-> rs-> moction EOF ()}} function EOF () {IF ($ this-> rs <>" ") {Return $ this-> rs-> EOF;}} Function Field_Value ($ FIELD_NAME) {IF ($ this-> rs <> "") {Return $ this-> rs-> fields [$ field_name] -> value;}} Function destroy () {if ($ this-> rs <> "") {$ this-> rs-> close ();} $ this-> conn-> close (); $ this-> rs = null; $ This-> conn = null;}}?> / / ===================================== Use code // =====================================================================================================================================================================================
$ OBJ-> Query ("Query Statement");
While ($ OBJ-> EOF ()) {$ OBJ-> Field_Value ("Field Name"); $ OBJ-> NEXT ();} $ OBJ-> Destroy (); // Manual Release?>