By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,833 Members | 2,067 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,833 IT Pros & Developers. It's quick & easy.

php dsnless connection for MS Access

P: n/a
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

Jan 22 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
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.Connection");
$dsn = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial
Catalog=tsos;Data Source=(local);Application Name=SellCar";
$db->Open($dsn);
$rs = $db->Execute("SELECT * FROM states order by name asc");
while (!$rs->EOF)
{
echo $rs->Fields['name']->Value."
";
$rs->MoveNext();
}
?>
Diego Bandeira.

"MrsBean" <li***@burnsidebiz.com> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com...
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

Jan 23 '06 #2

P: n/a
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" <li***@burnsidebiz.com> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com...
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

Jan 23 '06 #3

P: n/a
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:
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

Jan 23 '06 #4

P: n/a
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:
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" <li***@burnsidebiz.com> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com...
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


Jan 23 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.