473,566 Members | 2,908 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 9729
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" <li***@burnside biz.com> wrote in message
news:11******** **************@ g49g2000cwa.goo glegroups.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***@burnside biz.com> wrote in message
news:11******** **************@ g49g2000cwa.goo glegroups.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***@burnside biz.com> wrote in message
news:11******** **************@ g49g2000cwa.goo glegroups.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
2220
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. Can anyone lend some insight? thanks Object required: 'oConn' /Connections/conn.asp, line 2 <%
2
4334
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 DSN. Many thanks Tony
2
1428
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 Source=c:\\MyAccessDb.mdb;"; OdbcConnection conn = new OdbcConnection(connstr); conn.Open(); ...
14
3485
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, one developer suggested that it's a security flaw; therefore connection strings should be kept somewhere else or encrypted. My argument is that...
2
1854
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};" & _ "SYSTEM=SystemName;DBQ=LibraryName,Libraries;", sUserID, sPassword This fails everytime with an error message saying "Password for <sUserIdon server <SystemNameis...
20
3253
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 many connection has been used ? 2. If the maximum pool size has been reached, what happens when I call the method Open to open the connection ? Will I...
4
3396
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 Set cn = New ADODB.Connection
6
8146
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 server mobile ce database. Until recently I was synching everything thru a com port serial cable. The devices would connect to the computer thru...
8
4244
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 MyWorkspace = CreateWorkspace("", "admin", "", dbUseODBC) Dim MyConnection As DAO.Connection Set MyConnection = MyWorkspace.OpenConnection("", , ,...
0
7584
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8108
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7951
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6260
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5213
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3643
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2083
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1201
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
925
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.