...

View Full Version : Mysql remote Connection-using Javascript



jmohan
04-29-2008, 08:03 AM
Dear all,

I am developing a toolbar using javascript for my website. In our LAN, I can access the mysql database through asp.net application. But I am unable to connect mysql database via toolbar remotely.But the toolbar connected to mysql database in my local system.

I am using the following toolbar script to make mysql database connection remotely,

var a=tool.toolbarid;

var adoConn = new ActiveXObject("ADODB.Connection");
var adoRS = new ActiveXObject("ADODB.Recordset");

adoConn.Open("Driver={MySQL ODBC 3.51 Driver};Server=system2;Port=3306;Database=RemoteConnect;User=root; Password=harsha1;Option=3;");
MainWindow.document.parentWindow.alert('Database Connected');

adoConn.Execute("insert into tbgetid values('" + a + "')");

MainWindow.document.parentWindow.alert('Data Saved Successfully !');

adoConn.Close();
adoRS.Close();

Please help me to make the remote mysql database connection using javascript for the toolbar of my website,

Thanks in Advance,

J. Mohan.

abduraooft
04-29-2008, 10:31 AM
javascript is client side scripting language and database operations belongs to sever side. So javascript itself is not capable to handle DB, but you could invoke some server side script by javascript, using Ajax



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum