php dsnless connection for MS Access

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • MrsBean

    #1

    php dsnless connection for MS Access

    I've been working on learning how to use PHP with MS Access, and as
    long as I use ODBC, I can make it work. I want to use a DSNless
    connection. Everthing I have tried has failed. Can anyone show me a
    simple example?

    MrsBean

  • Jim Michaels

    #2
    Re: php dsnless connection for MS Access

    there are no Jet or MS Access library functions in the default PHP. there
    is no way to do a dsn-less connection with PHP. You are stuck with ODBC.
    There are multiple ways to use the DSN, such as COM. I found this in the
    notes section of the extended CHM manual of PHP when I searched for "MS
    Access"
    but it is a DSN connection...

    Hello!
    This code appears work fine and fast to me, like mysql or msaccess.
    The server is working for an Intranet home page.
    <?php
    $db = new COM("ADODB.Conn ection");
    $dsn = "Provider=SQLOL EDB.1;Persist Security Info=False;User ID=sa;Initial
    Catalog=tsos;Da ta Source=(local); Application Name=SellCar";
    $db->Open($dsn);
    $rs = $db->Execute("SELEC T * FROM states order by name asc");
    while (!$rs->EOF)
    {
    echo $rs->Fields['name']->Value."
    ";
    $rs->MoveNext();
    }
    ?>
    Diego Bandeira.



    "MrsBean" <linda@burnside biz.com> wrote in message
    news:1137952986 .185748.122670@ g49g2000cwa.goo glegroups.com.. .[color=blue]
    > I've been working on learning how to use PHP with MS Access, and as
    > long as I use ODBC, I can make it work. I want to use a DSNless
    > connection. Everthing I have tried has failed. Can anyone show me a
    > simple example?
    >
    > MrsBean
    >[/color]


    Comment

    • Jim Michaels

      #3
      Re: php dsnless connection for MS Access

      is MySQL a consideration, if nothing else, for later? it has an
      Access-to-MySQL Migration tool you can download, the database is faster and
      more flexible (unless you are doing pivots and using plugins).
      it would be worth the learning. Actually, both Access and database servers
      are used in jobs.
      MySQL usually comes with PHP when you purchase web hosting if you get PHP.
      MySQL is also free for development use if you are developing things that are
      not embedded - you can also use it to learn on.
      You can also create your tables, databases, and your data in batch scripts,
      and do backups in text-editable format. (or in code)
      You can also create views, which are saved queries (similar to what Access
      has), stored procedures and functions (Access's macros), SQL2's syntax +
      additions.
      It can handle more data and more users simultaneously. It has row locking.
      or you can lock tables (row locking is better).
      there is a longtext type (there are many more useful types), which can
      handle as much text as you can throw at it - such as a whole web page.
      Access's memo field can't do that.
      SQL knows how to do time calculations and other calculations, string
      manipulations, and very complex queries (including nested SELECTS).
      It also has some special search functions, like MATCH() and FULLTEXT(), some
      of which are likely used in search engines.

      drawbacks:
      you don't get Access's visual relationship diagramming tool.
      you don't get reports and forms (you're probably not using those anyway)
      higher learning curve (but good knowledge)

      if you want to find out more about row locking,
      http://dev.mysql.com/doc/refman/5.0/...l-locking.html you will see
      some code examples and ideas.
      There may be a 3rd party DB client that has the relationship diagramming
      tool, unless it's patented by MS.

      "MrsBean" <linda@burnside biz.com> wrote in message
      news:1137952986 .185748.122670@ g49g2000cwa.goo glegroups.com.. .[color=blue]
      > I've been working on learning how to use PHP with MS Access, and as
      > long as I use ODBC, I can make it work. I want to use a DSNless
      > connection. Everthing I have tried has failed. Can anyone show me a
      > simple example?
      >
      > MrsBean
      >[/color]


      Comment

      • Dikkie Dik

        #4
        Re: php dsnless connection for MS Access

        I just did the other way around: experimented with MySQL tables linked
        from MS-Access. What is your Connect string?
        I know that from access'97, you have to prepend "ODBC;", but I think
        that has to do with the DAO library (ADO does NOT work when you prepend
        that).

        Best regards

        MrsBean wrote:[color=blue]
        > I've been working on learning how to use PHP with MS Access, and as
        > long as I use ODBC, I can make it work. I want to use a DSNless
        > connection. Everthing I have tried has failed. Can anyone show me a
        > simple example?
        >
        > MrsBean
        >[/color]

        Comment

        • MrsBean

          #5
          Re: php dsnless connection for MS Access

          I am an Access developer. I have a customer who was interested in
          developing a PHP interface to their Access database on an intranet.
          This is more of a learning experience than anything. Thanks everyone
          for your input. I guess we'll just use DSN.

          Linda

          Jim Michaels wrote:[color=blue]
          > is MySQL a consideration, if nothing else, for later? it has an
          > Access-to-MySQL Migration tool you can download, the database is faster and
          > more flexible (unless you are doing pivots and using plugins).
          > it would be worth the learning. Actually, both Access and database servers
          > are used in jobs.
          > MySQL usually comes with PHP when you purchase web hosting if you get PHP.
          > MySQL is also free for development use if you are developing things that are
          > not embedded - you can also use it to learn on.
          > You can also create your tables, databases, and your data in batch scripts,
          > and do backups in text-editable format. (or in code)
          > You can also create views, which are saved queries (similar to what Access
          > has), stored procedures and functions (Access's macros), SQL2's syntax +
          > additions.
          > It can handle more data and more users simultaneously. It has row locking.
          > or you can lock tables (row locking is better).
          > there is a longtext type (there are many more useful types), which can
          > handle as much text as you can throw at it - such as a whole web page.
          > Access's memo field can't do that.
          > SQL knows how to do time calculations and other calculations, string
          > manipulations, and very complex queries (including nested SELECTS).
          > It also has some special search functions, like MATCH() and FULLTEXT(), some
          > of which are likely used in search engines.
          >
          > drawbacks:
          > you don't get Access's visual relationship diagramming tool.
          > you don't get reports and forms (you're probably not using those anyway)
          > higher learning curve (but good knowledge)
          >
          > if you want to find out more about row locking,
          > http://dev.mysql.com/doc/refman/5.0/...l-locking.html you will see
          > some code examples and ideas.
          > There may be a 3rd party DB client that has the relationship diagramming
          > tool, unless it's patented by MS.
          >
          > "MrsBean" <linda@burnside biz.com> wrote in message
          > news:1137952986 .185748.122670@ g49g2000cwa.goo glegroups.com.. .[color=green]
          > > I've been working on learning how to use PHP with MS Access, and as
          > > long as I use ODBC, I can make it work. I want to use a DSNless
          > > connection. Everthing I have tried has failed. Can anyone show me a
          > > simple example?
          > >
          > > MrsBean
          > >[/color][/color]

          Comment

          Working...