Hello,
I would like to access W2K Eventlog from PHP via ODBC - access to the
system is enabled by "WBEM Driver" (supplied on the W2K CD). My code
looks like this:
$connection = odbc_connect("WBEM Source", "", "")
or die(odbc_errormsg());
$select = "SELECT * FROM Win32_NTLogEvent WHERE Logfile =
'Application'";
$query_result = odbc_do($connection, $select)
or die(odbc_errormsg());
odbc_fetch_row($query_result);
echo odbc_result ($query_result, 1);
odbc_close($connection);
Error produced: "Warning: odbc_do(): SQL error: [Microsoft][WBEM ODBC
Driver][ISAM]Failed to obtain provider interface, SQL state S0000 in
SQLExecDirect".
I suspect I need to pass WMI namespace 'root\cimv2' to the
odbc_connect() function (like with
C:\WINNT\system32\wbem\wbemtest.exe) - but HOW? I've found only
examples for ASP or VB on the Internet. Thanks in advance.
Links:
Querying with WQL
http://msdn.microsoft.com/library/de...g_with_wql.asp
Mapping WMI to ODBC
http://msdn.microsoft.com/library/de...mi_to_odbc.asp