12-12-2006, 04:48 AM
I am trying to connect to the client database from the application deployed in server. I have done this using ActiveXObjects. It is working fine in IE but problem with FireFox. Since FF don't allow ActiveXObjects i decided to do this without using ActiveXObjects.
It is very urgent can anyone help me in this.
Thanks in advance...
12-12-2006, 05:31 AM
ActiveX is weird. It's IE only, and has special stuff it can do (and presents security risks, etc. to the user).
12-12-2006, 05:51 AM
Thanks for giving advice.
Could you pls help me by providing the sample code to implement the solution.
12-12-2006, 06:02 AM
Activex works without much problems on the server-side.
In ASP, ASP.NET they employ Activex.
Why don't you post the code you were using or the language preference for this job.
12-12-2006, 06:29 AM
Code below is what i am using. This is working fine with IE, but problem with FF. Since FF doesn't support ActiveXObjects.
I need a sample code to connect client database from the server application(testDB.asp) which is compatible with IE and FF
pls help me it is very urgent.
var conn = new ActiveXObject("ADODB.Connection")
var conn_str = ""
var dbHost = ""
var dbUser = ""
var dbPassword = ""
var dbProvider = ""
var dbDefault = ""
dbHost = "localhost";
dbUser = "sa";
dbPassword = "";
dbProvider = "SQLOLEDB";
dbDefault = "Northwind";
conn_str = "Provider="+dbProvider+";Data Source="+dbHost+"; User Id="+dbUser+"; password="+dbPassword+"; Initial Catalog="+dbDefault;
alert("Error creating Connection")
12-12-2006, 06:55 AM
Instead of using your database manipulation code on the client side do it in the server side so that your web server will process whatever database manipulation script before sending the results to the client browser.
It is not appropriate to have a database manipulating script in the client side script due to security reasons also.
12-12-2006, 07:15 AM
Thanks for the help.
I have tried this earlier, but the problem is with DB connections across domains.
As per my knowledge since the application is placed on the webserver it is not possible to connect client DB from server.
Also i have the requirement to provide an interface to the users such that they can connect to their own databases(eg: SQLSERVER) simply by providing the DB details of localhost.
My approches so far i have done:
1) Initially i have tried this all with asp, but it raised an issue of DB connection not possible across domains.
2) Second i have tried this by completely migrating the application to client side using JS. but raised the problem with ActiveXobjects
Hope u got my problem. pls help me very urgent
Thanks in advance...
12-12-2006, 08:39 AM
I am having difficulty with the way you are specifying your database location. Usually in a website development database will be either stored in the machine where your site resides or on another machine with which the web server machine has connectivity.
In your case you are telling that you need to connect to the databases that are in client machine(s). Are you telling that each user has their own database in their choosen database package?
Is this something not related to the normal web development process?
12-12-2006, 09:13 AM
yes, you are right. I need to manipulate the databases of client's from the server.
Could you pls help me in what way i can proceed with this kind of requirement using ASP and JS with SQLSERVER.
Thanks in advance. very urgent...
12-12-2006, 10:33 AM
Because of this reason all the important operations like database manipulation are done at the server-side.
You can keep a centralised database rather than having a database on each of your clients, which is not practical at all due to so many reasons like accessibility, security, etc. If the client makes any change in the database (which can be done at their will as the database is stored in their machine) that will create problems for your script as a result you won't get the result as supposed.
I don't know what type of application/task you are dealing with but it would be better if you redesign the current application design.
You can post your problem in the forum so that you'll get more good ideas from the forums users and carry out your job in an efficient manner.
12-14-2009, 04:45 PM
I'd like to revive this post from death because i've got a similar issue.
12-15-2009, 07:14 AM
You are then using a browser for a task it is not really designed for: browsers are meant for browsing the web, not acting as applications. To be blunt, that's like trying to hit a nail with a toothpick. Entirely different tool for an entirely different purpose, and sure there may be some especially powerful toothpicks, but you're not going to find a solution that will work for every toothpick to hit every nail.
Certainly they can be useful in other ways, but their general support for things that deviate too much from the norms will drop off and often end up browser specific.
You can in fact use server side code. In this case, the browser and the server are the same machine. That would mean setting up the computer as a web server, though.
I don't know of a decent way to make this really work cross-browser. With other additions to the browser there are ways, for example:
1) Firefox extensions. I don't know exactly how these work, but they have a lot less security working against them and you can work with files on the local machine easily. An ftp extension I use allows manipulation of (storing/deleting) local files, for example.
2) ActiveX. ActiveX is a pain, though, because it is IE-only and it is a security risk so often disabled. However, if you are making this as a tool for yourself and possibly other "trained" users, then that's no problem. Just never use firefox (or other browsers), and tell them to do the same. That's the easy solution to your problem here.
3) Use an applet of some sort, like a Java applet. But once you do that why not just make an exe with Java?
In the end, there are two options: 1) use a working but limited solution (like activex only in IE), or 2) move on to a desktop programming language that is actually meant to handle this sort of thing, such as Java or C++.
If you really want this to be browser-based, then I suggest looking into some of the more creative options allowed within certain browsers, such as firefox extensions. That's where I'd start if I wanted to make this a powerful and stable application. Of course ActiveX, though, may be a bit easier if you don't mind always using IE (and ActiveX).
Powered by vBulletin® Version 4.2.2 Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.