PHP
  Home arrow PHP arrow Page 6 - PHP and COM
Dev Shed Forums  
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
VPS Hosting  
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid  
Request Media Kit
Contact Us  
Site Map  
Privacy Policy  
Support  
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
PHP

PHP and COM
By: Harish Kamath, (c) Melonfire
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 13
    2002-04-23


    Table of Contents:
  • PHP and COM
  • Striving To Excel
  • The Number Game
  • Export Potential
  • Keeping It Simple
  • Access-ing The Web
  • All For One, And One For All
  • New Coins For Old
  • Link Zone

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article

     
     
    ADVERTISEMENT


    PHP and COM - Access-ing The Web
    ( Page 6 of 9 )

    How about one more, this time using the third member of the Microsoft Office family - Microsoft Access?

    What do I have in mind for this example? Well, I plan to manipulate (add/edit/delete) records in a Microsoft Access database using a Web browser and a bunch of PHP scripts.

    At first glance, this might not seem like a big deal. You're probably already familiar with manipulating a MySQL database with PHP - PHP comes with built-in functions to do this, and the MySQL connectivity in PHP is easily one of the more important reasons for the language's popularity. And you might also be familiar with manipulating Microsoft Access tables via ODBC. But what I have in mind is a little different.

    Since this is an article about COM, I don't intend to use either ODBC or PHP's MySQL functions to modify the Microsoft Access database. Instead, I'll be using the methods and properties of the ADODB COM object, in order to demonstrate an alternative technique.

    First, here's the Microsoft Access database, holding information on my coin collection in a single table. You may assume that the database is named "phpcom" and the table containing the records is called "coins".



    Now, I need to create a Web based interface to modify this database with PHP.

    The first step is to create a Data Source Name (DSN) in order to access the database through ODBC. Pop open your Control Panel and use the ODBC module to create this DSN. Tab to the "System DSN" section, and add a new DSN.



    Select "Microsoft Access Driver" from the list of available drivers. Set a data source name ("phpcom"), a description ("DSN for PHP/Access connection") and the name of the database to be accessed ("phpcom").



    Save your changes, and go back to your PHP editor. It's time to start writing some code.

     
     
    >>> More PHP Articles          >>> More By Harish Kamath, (c) Melonfire
     

       

    PHP ARTICLES

    - Building Dynamic Queries with Chainable Meth...
    - PHP Encryption and Decryption Methods
    - Building a MySQL Abstraction Class with Meth...
    - Completing a Sample String Processor with Me...
    - Mastering WHILE Loops for PHP and MySQL
    - Method Chaining: Adding More Methods to the ...
    - Method Chaining in PHP 5
    - The Role of Interfaces in Applying the Depen...
    - Dependency Injection: Using a Setter Method ...
    - Using a Model Class with the Dependency Inje...
    - Injecting Objects Using Setter Methods with ...
    - Injecting Objects by Constructor with the De...
    - The Dependency Injection Design Pattern in P...
    - Performing Inferential Statistical Analysis ...
    - Performing Descriptive Statistical Analysis ...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 3 Hosted by Hostway
    Stay green...Green IT