php dsnless connection for MS Access

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
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?  


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  
but it is a DSN connection...

This code appears work fine and fast to me, like mysql or msaccess.
The server is working for an Intranet home page.
 $db = new COM("ADODB.Connection");
 $dsn = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial  
Catalog=tsos;Data Source=(local);Application Name=SellCar";
 $rs = $db->Execute("SELECT * FROM states order by name asc");
 while (!$rs->EOF)
    echo $rs->Fields['name']->Value."
Diego Bandeira.

Quoted text here. Click to load it

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 +  
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.

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, 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.

Quoted text here. Click to load it

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.


Jim Michaels wrote:
Quoted text here. Click to load it

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  

Best regards

MrsBean wrote:
Quoted text here. Click to load it

Site Timeline