Link to home
Start Free TrialLog in
Avatar of shakila
shakila

asked on

dataconnection in javascript

asp sorce code (server side)

how to connect data source name(dsn)connection using javascript

for example <%@language="vbscript"%>
like this we have to use javascript instead of vbscript

please answer with code example
Avatar of PBall
PBall

var conn = Server.CreateObject("ADODB.Connection");
conn.open "DSN here","username here","password here"
:
: do whatever here
:
conn.close
conn = null

to specify code to run on server, you can change that directive to @language="JScript"

or put the code in a script block

<SCRIPT LANGUAGE="JavaScript" RUNAT=SERVER>
:
:code here
:
</SCRIPT>
ASKER CERTIFIED SOLUTION
Avatar of sadhu
sadhu

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
GREETINGS!

This question was awarded, but never cleared due to the JSP-500 errors of that time.  It was "stuck" against userID -1 versus the intended expert whom you awarded.  This corrects the problem and the expert will now receive these points; points verified.

Please click on your Member Profile and select "View Question History" to navigate through any open or locked questions you may have to update and finalize them.  If you are an EE Pro user, you can also choose Power Search to find all your open questions.

This is the Community Support link, if help is needed, along with the link to All Topics which reflects many TAs recently added.

https://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
https://www.experts-exchange.com/jsp/zonesAll.jsp
 
Thank you,
Moondancer
Moderator @ Experts Exchange