HI,
I AM TRYING TO ACCESS MS SQL 2005 DATABASE THROUGH JAVASCRIPT BUT IT GIVING ME RUNTIME ERROR. - <SCRIPT type="text/javascript">
-
<!--
-
function Aufruf(){
-
var rst;
-
var dsn;
-
var sql;
-
var newWindow;
-
try
-
{
-
var rst = new ActiveXObject("ADODB.Recordset");
-
var connection = new ActiveXObject("ADODB.Connection");
-
connection.Open ("Provider=SQLOLEDB.1;Persist Security Info=False;UserID=myID;Initial Catalog=Projekt;Data Source=MyServer;pwd=mypass");
-
sql = ("select moiveId, title from movie");
-
rst.Open (sql, dsn);
-
newWindow = window.open("","","width=600, height=400,top=200
-
left=200,scrollbars");
-
while (!rst.EOF){
-
newWindow.document.write(rst(0) + " " + rst (1));
-
newWindow.document.write("<br>");
-
rst.moveNext();
-
-
rst.Close();
-
}
-
catch{
-
txt="There was an error on this page.\n\n"
-
txt+="Error description: " + err.description + "\n\n"
-
txt+="Click OK to continue.\n\n"
-
alert(txt)
-
}
3 3841
As far I know JavaScript basically being a client side language cannot access a database which is usually in a server. A server side lang such as CGI, PHP, JSP, ASP or similar need to be used. Or you can use AJAX
HI,
I AM TRYING TO ACCESS MS SQL 2005 DATABASE THROUGH JAVASCRIPT BUT IT GIVING ME RUNTIME ERROR.
What kind of runtime error?
PS. please don't use only caps when typing - it looks like you're shouting!
As far I know JavaScript basically being a client side language cannot access a database which is usually in a server. A server side lang such as CGI, PHP, JSP, ASP or similar need to be used. Or you can use AJAX
JavaScript can't access a database, but ActiveX can. However, it's only supported by IE.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Nomad |
last post by:
I'm trying to load an XML document into the DOM using the ActiveXObject
I've succeeded in doing this on one machine. Which shouldn't becaus
I've checked for the ActiveXObject and it doesn't...
|
by: Peter Kirk |
last post by:
Hi there,
I am having trouble with ActiveXObject. I have a function which includes
this snippet:
alert('INIT 1');
orgdoc = new ActiveXObject('Microsoft.XMLDOM');
alert('INIT 2');
I see...
|
by: ndronen |
last post by:
Hi:
I have a DLL compiled from C# that I have to be able to use within an
HTML document. This is relatively easy to do following the suggestions
on this page:
...
|
by: RamyaKarthik |
last post by:
pls give some guide lines for developing project for online survey usin c++
|
by: shaanxxx |
last post by:
if u give cordinates to programme at run time and want a line to be
drawn.. how to do this in c without usin any graphics function?
like x1,y1 and x2,y2
and lines should be drawn from the 1st...
|
by: tokcy |
last post by:
Hi everyone,
I am new in php and ajax, i am facing the prob while i click on element of first drop down then in second dropdown all element showl come from database.
I mean i have three dropdown 1....
|
by: Sunny |
last post by:
In IE, we can open an access database uing an Active X Object.
How I can do the same in Firefox.
As Firefox, dont allow you to create a Active X Object.
Here is the IE Code.
var myConnect =...
|
by: nitinsingh1 |
last post by:
Hi,
I am using ActiveXobject as
var xp = new ActiveXObject("WPrint.PrintCtl");
in my JSP application.
I have heard that using ActiveXobject may be dangerous for my application as i am using...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| |