[Solved] PHP and MS Access
Moderator: General Moderators
[Solved] PHP and MS Access
Hi
I am fond of Web Apps but bump !!
I've got a fingerprint machine which is linux that connect to a database by a simple win application. Now the application can only use ms access for their database -- I hate it so much, mssql will be much better -- since their win application not quiet correct on managing the attendance data. I decided to create one of my own but using web apps and of course PHP.
I had installed all the necessary tool and program to connect to Ms Access in LINUX using ODBC driver thru DSN Connection.
It success, no problem in connecting
no problem in SELECT query, it return result.
problem with UPDATE, INSERT, DELETE query. The query doesn't effect the Database , no error return even if it's a simple query like "UPDATE test SET name = 'wpsd' WHERE id = 1"
I read that MS Access have problem with permission, but I'm able to change the database from C# win Apps but not PHP.
And also read that you won't be able to update/insert/delete table that have relationship. So I try create a simple database with one table only, the table call test and have attribute id and name . Then I try use the simple query above, but no luck.
Any one have experience using LAMP and MS Access ? All the tutorial seems only show how using SELECT query
I am fond of Web Apps but bump !!
I've got a fingerprint machine which is linux that connect to a database by a simple win application. Now the application can only use ms access for their database -- I hate it so much, mssql will be much better -- since their win application not quiet correct on managing the attendance data. I decided to create one of my own but using web apps and of course PHP.
I had installed all the necessary tool and program to connect to Ms Access in LINUX using ODBC driver thru DSN Connection.
It success, no problem in connecting
no problem in SELECT query, it return result.
problem with UPDATE, INSERT, DELETE query. The query doesn't effect the Database , no error return even if it's a simple query like "UPDATE test SET name = 'wpsd' WHERE id = 1"
I read that MS Access have problem with permission, but I'm able to change the database from C# win Apps but not PHP.
And also read that you won't be able to update/insert/delete table that have relationship. So I try create a simple database with one table only, the table call test and have attribute id and name . Then I try use the simple query above, but no luck.
Any one have experience using LAMP and MS Access ? All the tutorial seems only show how using SELECT query
Last edited by wpsd2006 on Mon Feb 22, 2010 5:42 am, edited 1 time in total.
Re: PHP and MS Access
You might want to look in to this: http://www.ucl.ac.uk/is/mysql/access/
Re: PHP and MS Access
I check but not exactly what I needed.
I dont want to change the access to mysql cause the win application that can download the attendance data from machine can only use access ( this is my next problem but can discuss later )
main problem is php odbc cannot manipulate access database, it can only do a "select" query
Anyone succeed in manipulate access database thru php in Linux ?
I dont want to change the access to mysql cause the win application that can download the attendance data from machine can only use access ( this is my next problem but can discuss later )
main problem is php odbc cannot manipulate access database, it can only do a "select" query
Anyone succeed in manipulate access database thru php in Linux ?
Re: PHP and MS Access
Here's another thread that might be helpful. Pay close attention to escaping spaces and reserved words.
http://forums.codewalkers.com/database- ... 32265.html
http://forums.codewalkers.com/database- ... 32265.html
Re: PHP and MS Access
Thanks
I already check that example before, but my sql much more simple :
UPDATE test SET name = 'wpsd' WHERE id = 1
Does this query wrong in ms access ?
I try it in ms access it's working but not php.
I really have the table in ms access for testing.
It call test with only two field ( id: number, name: text )
I already check that example before, but my sql much more simple :
UPDATE test SET name = 'wpsd' WHERE id = 1
Does this query wrong in ms access ?
I try it in ms access it's working but not php.
I really have the table in ms access for testing.
It call test with only two field ( id: number, name: text )
Re: PHP and MS Access
Are you using DSN?
Re: PHP and MS Access
Yep I using DSN thru odbc.ini and using libmdbodbc.so to connect
The SELECT query works well can return result but not the other IUD (Input Update Delete) query
The SELECT query works well can return result but not the other IUD (Input Update Delete) query
Re: PHP and MS Access
Do you have access to another system to try it on. Perhaps that system has some sort of JET corruption or something.
Re: PHP and MS Access
yep but not linux
I'll try it again, i hope it can works in ubuntu cause my other application using LAMP
I'll try it again, i hope it can works in ubuntu cause my other application using LAMP
Re: PHP and MS Access
I meant another box with Access on it. Troubleshoot from every angle. Try to use another program to connect also. Do you have access to ASP? You have to find the source of the error, don't assume it's your php code or the php odbc driver (though it might be).
-
Brian Swan
- Forum Newbie
- Posts: 17
- Joined: Thu Jan 14, 2010 11:56 am
Re: PHP and MS Access
Does your test table have a PK (or unique index) defined? If not that may be the problem: Access uses a keyset cursor for updating data, which means that it fetches the first few rows and then the keys for the rest. If there’s no PK or unique index defined, it fetches a snapshot (all the rows), which is read-only.
This article might be helpful: http://msdn.microsoft.com/en-us/library ... L.90).aspx. It addresses SQL Server connectivity, but it contains information about how Access works on the client side that should be helpful.
Hope that helps.
-Brian
This article might be helpful: http://msdn.microsoft.com/en-us/library ... L.90).aspx. It addresses SQL Server connectivity, but it contains information about how Access works on the client side that should be helpful.
Hope that helps.
-Brian
Re: PHP and MS Access
Hmm Okay let's back to the simple prob
How do I update a table using php_odbc ?
I just call odbc_exec("UPDATE .... ") should be enough right ?
How do I update a table using php_odbc ?
I just call odbc_exec("UPDATE .... ") should be enough right ?
Re: PHP and MS Access
After checking all the mdb tools and library in linux found out that it only support select query
Guess the solution is seperate the server
Guess the solution is seperate the server