It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming ASP & ASP.NET Forum

How to connect database using Javascript in ASP page ?

How to connect database using Javascript in ASP page ?

Postby PRATANSH on Sat Sep 03, 2011 5:17 am

Hello Everyone,

I am using Javascript in ASP page to connect to the database. I am not able to figure out where is the problem.
Gettting this error->

Error Type:
Microsoft OLE DB Provider for SQL Server (0x80004005)
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.
/MyWeb/test.asp, line 9


My code is->
Code: Select all
<%@ Language = JavaScript %>
<%
      var myconnection
      var myrecordset
      var connectionString

      myconnection = Server.CreateObject("adodb.connection")
      connectionString = "Provider=SQLOLEDB.1;Password=myPwd;Persist Security Info=True;User ID=myId;Initial Catalog=MyTable;Data Source=MyCompName\MyDBINSTANCE"
      myconnection.Open(connectionString, myconnection);

%>

If someone could please guide me in the right direction I would greatly apprieciate it.

Thanking You. :?: :?:
PRATANSH
 
Posts: 1
Joined: Sat Sep 03, 2011 4:58 am

Who is online

Users browsing this forum: No registered users and 0 guests