Delphi For PHP Forums       


Go Back   Delphi-PHP Forums > Programming > Database Integration
Forum Jump Register FAQ Members List Downloads Search Today's Posts Mark Forums Read

Database Integration How to use MySql, PostgreSQL, MS SQL, Oracle, and most other databases with PHP.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10th April 2009, 08:40
D4PHP Newbie
 
Join Date: Apr 2009
Posts: 5
katran is on a distinguished road
Default How to connect Database component to Ms Acces (mdb) database

Did enybody tried had succes with connecting the Database component to an Ms Acces database file ?
I just tried to make an simple website : Database1 + Table1 + DataSource1 + DbGrid1 connected together to display/edit a table.
To connect to an MsSql Server database is no problem.
When I tried to connect to an Ms Acces database file (mdb), I got all the time erros.
I tried :
DataBase1 DriverName = "ado" , "ado_acces", "acces", "odbc"
and
DataBase1 DataBaseName = either "D:\MYDB.mdb" , either "TEST" - the name of an ODBC connection.

For all situations I got errors.
Did anybody had succes in getting connected to an mdb file ?
As far as I read in help, it should be possible to get connected to an MsAcces database.

Thank you in advance.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 10th April 2009, 13:54
405hp's Avatar
Firebug Fanatic
 
Join Date: Dec 2007
Location: State of Confusion
Posts: 3,216
405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute
Default

database problems
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 10th April 2009, 14:43
D4PHP Newbie
 
Join Date: Apr 2009
Posts: 5
katran is on a distinguished road
Default

Thank you for your answer.
I have found the example 2 days ago and it is working.

But .... I want the DATABASE/TABLE components to connect to the database.

Do you think I can write something like :

$connstr = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source =" . realpath("Projects.mdb") ."";
Table1->Open($connstr)
or Table1->Connection($connstr)
or Table1->Database($connstr)

What I want at the end, is to use the grid. But the Grid has to be connected to an DataSource, and the DataSource to an Table or Query component.
So finally I need to work with the Table component.
How to connect the table component to an Ms Acces database ?
Sorry ... I am completely new in PHP.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 10th April 2009, 18:58
405hp's Avatar
Firebug Fanatic
 
Join Date: Dec 2007
Location: State of Confusion
Posts: 3,216
405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute
Default

I have not used it but the doc's say it works.

ADODB Manual

The database component shows ado_access and access in the drop down for drivers.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 10th April 2009, 22:00
D4PHP Newbie
 
Join Date: Apr 2009
Posts: 5
katran is on a distinguished road
Default

I know the doc. But for me did not work.
I tried several drivers (including these 2 you said).
If I will find a way, I will post the code.
Thanks for your replies.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 28th May 2009, 15:31
D4PHP User
 
Join Date: May 2009
Posts: 18
merovingio is on a distinguished road
Send a message via Skype™ to merovingio
Default

I use
Database->DriverName = "access";
Database->Host =
"DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=f:\\scuole.mdb;"
Table->Table = "scuole" // table
But I only read records with DBControls.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT +1. The time now is 03:38.




Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0 ©2009, Crawlability, Inc.
Copyright © 2004 - 2009, G&J Solutions Ltd. All Rights Reserved. terms of use