Showing posts with label ODBC Driver. Show all posts
Showing posts with label ODBC Driver. Show all posts

Wednesday, January 23, 2008

How-to AmiBroker MySQL ODBC driver.

Try to setting up a AmiBroker ODBC/SQL Data plugin, via MySQL ODBC driver.

It's here, to show what I have already did, and how I did it.
Maybe it can help someone.
Maybe someone can help me to go further.

My setting :
Windows 200 Pro
AmiBroker 5.03

Links :
http://www.amibroker.com/odbc.html

You need to install a MySQL database and something to manage it.
I think the easiest way is to use something all-in-one.

There are :
http://www.easyphp.org/
http://www.wampserver.com/
Maybe other.

I choose :
http://www.wampserver.com/
I downloaded the Windows release.
Install WampServer.
It set a tray icon.
You have to left or right click on the tray icon to access to all the commands.

Start WampServer.
Left click on the tray icon.
Choose phpMyAdmin.

Create a new database table
Start phpMyAdmin
Create a new database, TestMySQL for example.
Choose testmysql.
Click on the SQL tab.
Copy and pass the following SQL code :


CREATE TABLE `s2` (
`DATE` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
`OPEN` double NOT NULL,
`HIGH` double NOT NULL,
`LOW` double NOT NULL,
`CLOSE` double NOT NULL,
`VOLUME` double default '0',
`OPENINTEREST` double default '0',
PRIMARY KEY (`DATE`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Contenu de la table `s2`
--

INSERT INTO `s2` (`DATE`, `OPEN`, `HIGH`, `LOW`, `CLOSE`, `VOLUME`, `OPENINTEREST`) VALUES
('2006-01-07 08:01:00', 100, 112, 98, 110, 1000, 0),
('2006-01-07 08:02:00', 110, 122, 108, 120, 1000, 0),
('2006-01-07 08:03:00', 120, 132, 118, 130, 1000, 0),
('2006-01-07 08:04:00', 130, 142, 128, 140, 1000, 0),
('2006-01-07 08:05:00', 140, 152, 138, 150, 1000, 0),
('2006-01-07 08:06:00', 150, 162, 148, 160, 1000, 0),
('2006-01-07 08:07:00', 160, 172, 158, 170, 1000, 0);




Now you have a new Table named s2, with somes records for test purpose.

The MySQL ODBC Driver
Now you have to dowload and install the MySQL ODBC Driver :
MySQL ODBC Driver

I choose the Windows 32 one.

Start phpMyAdmin and add a ODBC user for your database.

Start / Execute / odbcad32.exe

Click the image to enlarge it.













Database settings / Configure
Click the image to enlarge it.

Start AmiBroker.
Create a new database.