[ciapug] Question on MetaType in adodb lib

David Champion dave at visionary.com
Wed Sep 21 13:19:38 CDT 2005


2 possibilites... either your version of ADODB doesn't support MetaType, 
or ADODB doesn't support it for Microsoft SQL server.

I would make sure you have the newest version of ADODB installed, and 
also try it against a MySQL data source to see if that works.

-dc

Mark Mikkelson wrote:
> 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
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> ciapug mailing list
> ciapug at cialug.org
> http://cialug.org/mailman/listinfo/ciapug




More information about the ciapug mailing list