Friday, September 14, 2012

Demo Ajax Database

The objective of this post is to replicate the demo that is provided with HTML5Builder called
Demos>Ajax>Database
On my computer it is here
C:\Users\Public\Documents\HTML5 Builder\5.0\Demos\Ajax\Database
It is accessible via the "start" menu (What do you call it in Windows 7?)
Start>Programs>Embarcadero HTML5 Builder>Demos


So I double click on ajaxdatabase.php and it opens in HTML5Builder.
I click the button to run it and IO get an error

The jist of the error is
Application raised an exception class EDatabaseError with message  
'Can't connect, PDO Exception: SQLSTATE[28000] [1045] 
Access denied for user 'user'@'localhost' (using password: YES)'

The first problem I have is that I do not know what database this example is trying to access - some internal one like the PHP that is installed with HTML5Builder or the one that is a part of my development machine.

Switch off WAMP server
Re run the demo and the error is different
Warning: PDO::__construct(): [2002] No connection could be made because the target machine actively (trying to connect via tcp://127.0.0.1:3306) in C:\Program Files (x86)\Embarcadero\HTML5 Builder\5.0\rpcl\dbpdo.inc.php on line 199
Application raised an exception class EDatabaseError with message 
'Can't connect, PDO Exception: SQLSTATE[HY000] [2002] 
No connection could be made because the target machine actively refused it.
'
Restarted WAMP server and got the original message.  So this says to me that the example is trying to use the external ie WAMP server.

I look at the icons and see that there is one called dBProducts
Host is localhost
DatabaseName is oscommerce
Username is user
UserPassword is ******
I suspect I need to
a) Get hold of oscommerce from womewhere
b) Change username to root and UserPassword to my mysql root password.

I find on the wiki here
http://docwiki.embarcadero.com/HTML5_Builder/en/Sample_Applications
This
There are sample applications that require a database management system to work. For those you are going to need to load the sample databases included in the sample applications folder into the target DBMS.

MySQL

For MySQL-based applications, there is an SQL script called oscommerce.sql, which you need to run on your MySQL server.
Note: The file contains non-ASCII characters, so pasting the content in an open MySQL console in an MSDOS window won’t work. Use the source oscommerce.sql command instead.






















No comments:

Post a Comment