PHP4 Access Msaccess Database Class

xiaoxiao2021-03-06  54

= ""; $ 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?>

转载请注明原文地址:https://www.9cbs.com/read-113173.html

New Post(0)