Sign in to follow this  
DBdeveloper

Connection Problem

Recommended Posts

Hello,

So I've been able to connect to the Access DB but now I'm trying to connect to our test server. I am almost positive that I have permission to connect to this server but I am not server savvy.... This is my BasicDBSampleSales.asp file and after that is my DBConn1.asp file.

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Language=VBScript %>
<HTML>
<head>
   	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

   	<title>FusionCharts - Database Example</title>
   	<link href="../assets/ui/css/style.css" rel="stylesheet" type="text/css" />
   	<script type="text/javascript" src="jquery.min.js"></script>
   	<script type="text/javascript" src="lib.js"></script>

   	<style type="text/css">
       	h2.headline {
           	font: normal 110%/137.5% "Trebuchet MS", Arial, Helvetica, sans-serif;
           	padding: 0;
           	margin: 25px 0 25px 0;
           	color: #7d7c8b;
           	text-align: center;
       	}
       	p.small {
           	font: normal 68.75%/150% Verdana, Geneva, sans-serif;
           	color: #919191;
           	padding: 0;
           	margin: 0 auto;
           	width: 664px;
           	text-align: center;
       	}
   	</style>
	<script LANGUAGE="Javascript" SRC="FusionCharts.js"></SCRIPT>
</HEAD>
<!-- #INCLUDE FILE="FusionCharts.asp" -->
<!-- #INCLUDE FILE="DBConn1.asp" -->
<BODY>

   	<div id="wrapper">

       	<div id="header">

          	<div class="logo"><a class="imagelink"  href="http://www.fusioncharts.com/" target="_blank"><img src="../assets/ui/images/fusionchartsv3.2-logo.png" width="131" height="75" alt="FusionCharts XT logo" /></a></div>
           	<h1 class="brand-name">FusionCharts XT</h1>
           	<h1 class="logo-text">FusionCharts Database and Drill-Down Example</h1>
       	</div>

       	<div class="content-area">
           	<div id="content-area-inner-main">
               	<h2 class="headline">Click on any pie slice to see detailed data</h2>

               	<div class="gen-chart-render">
<%
Dim oRs, oRs2, strQuery
Dim strXML

Set oRs = Server.CreateObject("ADODB.Recordset")
strXML = "<chart caption='Sales report' subCaption='By Quantity' pieSliceDepth='30' showBorder='1' formatNumberScale='0' numberSuffix=' Number of Sales'>"

strQuery = "select * from Sales"
Set oRs = oConn.Execute(strQuery)

While Not oRs.Eof
	Set oRs2 = Server.CreateObject("ADODB.Recordset")
	strQuery = "select count(Amount) as TotOutput from Sales group by Type"
	Set oRs2 = oConn.Execute(strQuery)					
	strXML = strXML & "<set label='" & ors("Type of Sale") & "' value='" & ors2("TotOutput") & "' />"
	Set oRs2 = Nothing
	oRs.MoveNext
Wend
strXML = strXML & "</chart>"
Set oRs = nothing

Call renderChart("Pie3D.swf", "", strXML, "SalesSum", 600, 300, false, false)
%>
               	</div>
               	<div class="clear"></div>
               	<p> </p>
               	<p class="small">Or, right click on any pie to enable slicing or rotation mode. </p>

               	<div class="underline-dull"></div>
           	</div>
       	</div>

       	<div id="footer">
           	<ul>
               	<li><a href="../index.html"><span>« Back to list of examples</span></a></li>
               	<li class="pipe">|</li>
               	<li><a href="../NoChart.html"><span>Unable to see the chart above?</span></a></li>
           	</ul>
       	</div>
   	</div>
</BODY>
</HTML>

 

I have removed the servername, username, and password for personal reasons.....

 

<%
Dim oConn
if not isObject(oConn) then
	'Dim strConnQuery
	Set oConn = Server.CreateObject("ADODB.Connection")		
	oConn.Open"Driver={SQL Server}; Server=______; Uid=____; Pwd=______; Database=Sales;"
end if
%>

 

Here is the error I get when I try to run it through ISS

Microsoft OLE DB Provider for ODBC Drivers error '80004005'

 

[Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or access denied.

 

/FusionChart/Evaluation/DBConn1.asp, line 6

 

If anyone sees anything obvious that I have brushed by please let me know.

Share this post


Link to post
Share on other sites
Guest Sumedh

Hi,

 

You would need to configure the database connection settings according to your database file setup and path.

 

Please refer this link for configuring the connectionstring : http://www.connectionstrings.com/sql-server-2008

 

Make necessary changes in the DBConn1.asp file according to the type of database.

 

Hope this helps.

Share this post


Link to post
Share on other sites

Hello,

So I've been able to connect to the Access DB but now I'm trying to connect to our test server. I am almost positive that I have permission to connect to this server but I am not server savvy.... This is my BasicDBSampleSales.asp file and after that is my DBConn1.asp file.

 

I have removed the servername, username, and password for personal reasons.....

 

<%
Dim oConn
if not isObject(oConn) then
	'Dim strConnQuery
	Set oConn = Server.CreateObject("ADODB.Connection")		
	oConn.Open"Driver={SQL Server}; Server=______; Uid=____; Pwd=______; Database=Sales;"
end if
%>

 

Here is the error I get when I try to run it through ISS

Microsoft OLE DB Provider for ODBC Drivers error '80004005'

 

[Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or access denied.

 

/FusionChart/Evaluation/DBConn1.asp, line 6

 

If anyone sees anything obvious that I have brushed by please let me know.

 

I had a lot of bs problems with connecting to mssql server so my only guess would be to try to change the driver and maybe remove the semicolon after sales?

 

Driver={SQL Server Native Client 10.0};Server=___;UID=_____;PWD=___;DATABASE=Sales

 

That is the only thing different in my code and yours. Also I have:

 

oConn.Mode =3

 

I don't know if that makes any difference but good luck!

Share this post


Link to post
Share on other sites
Guest Sashibhusan

Hi,

 

From the error "80004005", means is that the SQL Server you defined in your connection string is Invalid.

 

So, check whether:

 

1. The hostname you have given wrongly

 

2. You do not have permission to connect.

 

Here you need to check for Network related (check if it is set for TCP/IP) or Domain related security issues.

 

Also, could you please check once, connecting the server with the same user id and password through SQL Tools?

 

For more information on "Potential Cause for "SQL Server does not exist or access denied" error message ", please follow the link below:

http://support.microsoft.com/kb/328306/en-us

 

Hope this helps!

Edited by Sashibhusan

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this