473,413 Members | 1,854 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,413 software developers and data experts.

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

Jan 22 '06 #1
4 9717
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: shank | last post by:
I'm trying to setup an Access DSNLess connection on my local computer. The following string works fine within the Dreamweaver interface. But when I upload to my server (locally) I get this error....
2
by: Tony Epton | last post by:
<crossposted to several groups> Is there any way to create a DSNless connection to SQL server from access 97 (DAO) All the samples of connection strings I am finding - all have a reference to a...
2
by: Derrick | last post by:
Trying this code in the Page_Load of a C# web page... private void Page_Load(object sender, System.EventArgs e) { string connstr = "Provider=Microsoft.Jet.OLEDB.4.0;Data...
14
by: WebMatrix | last post by:
Hello, I have developed a web application that connects to 2 different database servers. The connection strings with db username + password are stored in web.config file. After a code review,...
2
by: hmyers | last post by:
We have converted an Access 97 database to Access 2000 on an XP machine. The application uses a DSN-less connection: adoConn1.Open "DRIVER={iSeries Access ODBC Driver};" & _...
20
by: fniles | last post by:
I am using VS2003 and connecting to MS Access database. When using a connection pooling (every time I open the OLEDBCONNECTION I use the exact matching connection string), 1. how can I know how...
4
by: matthooper | last post by:
Hello all, I have this peice of code that connects to a SQL server without the DSN Dim cn As ADODB.Connection Dim rs As ADODB.Recordset 'Create a new ADO Connection object...
6
Cintury
by: Cintury | last post by:
Hi all, I've developed a mobile application for windows mobile 5.0 that has been in use for a while (1 year and a couple of months). It was developed in visual studios 2005 with a back-end sql...
8
Dököll
by: Dököll | last post by:
Hiya Fans! I hit a brick wall. I was attempting to make a DSNLess connection I seemed to have Goofed somewhere: Private Sub SQLServer_Click() Dim MyWorkspace As DAO.Workspace Set...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.