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  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Sun Developer Network 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Moblin 
JMSL Numerical Library 
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: 4 stars4 stars4 stars4 stars4 stars / 10
    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:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb 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 a Content Management System with Co...
    - Filters and Login Systems for Web Applicatio...
    - Working with the Email Class in Code Igniter
    - Building Your Own System Tray Application Us...
    - Structuring Your Projects for Web Applicatio...
    - Inserting, Updating and Deleting Database Ro...
    - Building Your Own Desktop Notepad Applicatio...
    - Web Application Security Overview
    - Working with the Active Record Class in Code...
    - Generate PDF Documents with PHP on the Windo...
    - Sending Email with PHP Networking
    - Performing Strict Validation with the Code I...
    - The preg_replace_callback() function in PHP
    - PHP Networking
    - Validating Web Forms with the Code Igniter P...





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
    Stay green...Green IT