/    Sign up×
Community /Pin to ProfileBookmark

Connecting to Database using Javascript bot in IE and FireFox

Code below is what i have done exactly. It is working fine with IE, but problem with FireFox.
After my search regarding this i came to know that its a problem creating ActiveXObject in FireFox.
pls solve this it is very urgent<br />
&lt;script type=’text/javascript’&gt;
var conn = new ActiveXObject(“ADODB.Connection”)
var conn_str = “”
var dbHost = “”
var dbUser = “”
var dbPassword = “”
var dbProvider = “”
var dbDefault = “”
function getData()
{
dbHost = “localhost”;
dbUser = “sa”;
dbPassword = “”;
dbProvider = “SQLOLEDB”;
dbDefault = “master”;
conn_str = “Provider=”+dbProvider+”;Data Source=”+dbHost+”; User Id=”+dbUser+”; password=”+dbPassword+”; Initial Catalog=”+dbDefault;
getDatabase();
}
function getDatabase()
{
try
{
conn.Open(conn_str)
alert(conn)
}
catch(e)
{
alert(“Error creating Connection”)
}
}
&lt;/script&gt;
&lt;body onload=”getData()”&gt;
&lt;/body&gt;
<br />

Thanks in advance…….

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@A1ien51Dec 01.2006 — It is called....LEARN a serverside language. JavaScript is not mean to connect to a database. All of your database security info is out in the open an you will be hacked if someone is able to access this page.

Eric
×

Success!

Help @seshukumar_84k spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...