[ciapug] Question on MetaType in adodb lib

Mark Mikkelson mikkelson_mt at msn.com
Wed Sep 21 12:24:18 CDT 2005


I have a recordset that I would like to be able to filter based on the
MetaType value of the current field, so that I can display information that
is only stored in "bit" fields instead of all the other info that I pulled
into my recordset for purposes elsewhere in the code.  Does anyone know of a
way to do this?  Here is what I have tried so far...
 
ADOLoadCode('mssql');
$db = ADONewConnection('mssql');
$db->debug = false; 
$db->connect(dbserver,userid,password,dbname);
$db->SetFetchMode(ADODB_FETCH_ASSOC);
$sql = " select * from table where column = 'someval' ";
$rs = $db->Execute($sql);
while (!$rs->EOF) {
    foreach ($rs->fields as $k => $v) {
        if ($db->MetaType($rs->fields[$k]) == "L") {    //failure on this
line: Call to undefined method ADODB_mssql::MetaType()
            echo $v . "<hr />\n";
        }
    }
}
 
Mark Mikkelson
MCSA Messaging, CIW Professional
Web Specialist
mikkelson_mt at msn.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://cialug.org/pipermail/ciapug/attachments/20050921/13ff1b0c/attachment.html


More information about the ciapug mailing list