Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 09-03-2011, 05:29 AM   PM User | #1
PRATANSH
New to the CF scene

 
Join Date: Sep 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
PRATANSH is an unknown quantity at this point
Question How to connect database using Javascript in ASP page ?

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->
Quote:
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:
<%@ 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 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:53 AM.


Advertisement
Log in to turn off these ads.