WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDES  |  PHP CLASSES  |  CODE SEARCH  |  ARTICLES SEARCH  |  PHP FORUMS  |  PHP MANUAL  |  PHP FUNCTIONS LIST  |  WEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Submit Your Code
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
WeberDev's Monthly code contest PHP Code Contest
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Index
PHP Web Logs (BLogs)
Web Development Resources
Web Development Content
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
Submit Site
Forex Trading Online forex trading platform

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : COM Support in PHP
Categories : PHP, COM Click here to Update Your Picture
Pradeep Mamgain
Date : Jul 16th 2002
Grade : Be the 1st to grade this Code Example
Viewed : 5196
File : com-support-in-php.zip
Images : No Images for this code example.
Search : More code by Pradeep Mamgain
Action : Grade This Code Example
Tools : My Examples List

  Submit your own code examples 
 

COM functions are only available on the Windows version of PHP. In order to run this
script you should have com.allow_dcom has to be set to TRUE in php.ini. Through
these functions you can access any window application object. In this tutorial we
would access a MS-ACCESS database with ADODB object. Create a new .MDB file and name
it as COMDEMO. Create a New table TBCOM and then create two text fields SITE and
SITEDESC. Insert two or three entries manually. To create a new COM object use
syntax :

<?
$obj = new COM("server.object")
?>

Step : 1 ::: Setting the connection string
==========================================
<?
$connstr="Provider=Microsoft.jet.oledb.3.51;" . "Persist Security
info=false;" . "data
source=" . "comdemo.mdb" . ";";
?>

Step : 2 ::: Create the connection object and open it.
======================================================
<?
$adoconn=new COM("adodb.connection") or die("can not start Active X Data Objects");
$adoconn->Open($connstr);
?>

Step : 3 ::: Find recordset
===========================
<?
$recordset = $adoconn->Execute("select * from tbcom");
?>

Step : 4 ::: Get the total no of fields and place them in an array.
===================================================================
<?
$total_f=$recordset->fields->count();
echo "\n" . "Total No of fields : " . $total_f;
//Loop through and get name of fields.
$fld=array();
for ($i=0; $i < $total_f; $i++)
{
$fld[$i] = $recordset->Fields($i);
}
echo "<br>";
?>

Step : 5 ::: Loop through the recordset to get fields value.
============================================================
<?
$rowcnt = 0;
while (!$recordset->EOF)
{
for ($i=0; $i < $total_f; $i++)
{
echo $fld[$i]->value . " | ";
}
echo "<br>";
$rowcnt++;
$recordset->MoveNext();
?>

Step : 6 :: Close and release the objects.
==========================================
<?
$recordset->Close();
$adoconn->Close();

$recordset->Release();
$adoconn->Release();

$recordset = null;
$adoconn = null;
?>



MS Word Mail Merge Automation (COM)
Categories : PHP, PHP Classes, COM
com_get -- Gets the value of a COM Component's property
Categories : PHP, PHP Functions, COM
Query2Report : Generating Html, Pdf and Csv Reports from SQL Query
Categories : PHP, PHP, HTML, PDF, Excel
PHP-PDF-Converter
Categories : PHP, Excel, PDF, Microsoft Word, COM
Retrieve text from table and email to your e- address in pipe delimited format.
Categories : PHP, MySQL
Accepts a database & hostname from a user and then HTTP username and password. Uses this to connect to a MySQL database. Produces a form based on the tables it finds there to allow the user to do SELECTs, INSERTs, and DELETEs.
Categories : Databases, PHP, MySQL, Complete Programs
A PHP function to encrypt and decrypt a number or string or a combination of the two.
Categories : PHP, Encryption, Security
Using $PHP_AUTH_USER and $PHP_AUTH_PW to authenticate.
Categories : Authentication, PHP
file class , uploade file , download file already uploaded on another website
Categories : PHP, PHP Classes, Filesystem, Web Services
Authorize.net AIM Interface Class v1.0.0
Categories : PHP, PHP Classes, Ecommerce, Payment Gateways
Cut your MySQL Connections to 1 line of code
Categories : PHP, Beginner Guides, Databases, MySQL
A simple class with some HTML output functions that would come in handy for consistent page layout etc.
Categories : PHP, PHP Classes, HTML and PHP, HTML, Navigation
readline -- Reads a line
Categories : PHP, PHP Functions, Readline
a function that builds an HTML select list from any mysql table.
Categories : PHP, MySQL, HTML and PHP
Math operations on big numbers
Categories : PHP, Math.
 lera zubkova wrote :902
I tried to use COM object, but haven`t success :(
I have some distribudet DLL, written in VB and compiled as COM. Then I write script:

$obj = new COM("dllName.appName");

and every time I have windows error: "the memory could not be read"
If you have experience in using COM in PHP, please may be you can help me :)
10q!

(P.S. I have php 4.3.0, Apache and Windows 2000)