Wrox Programmer Forums
|
BOOK: ASP.NET Website Programming Problem-Design-Solution
This is the forum to discuss the Wrox book ASP.NET Website Programming: Problem - Design - Solution, Visual Basic .NET Edition by Marco Bellinaso, Kevin Hoffman; ISBN: 9780764543869
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET Website Programming Problem-Design-Solution section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 30th, 2006, 07:04 PM
Authorized User
 
Join Date: Jun 2006
Posts: 60
Thanks: 1
Thanked 0 Times in 0 Posts
Default Server Does Not Exist - Connect String

I'm having a problem connecting to my SQL server with an ASP connection string. Per a tip I read in this forum, I created a UDL file and created the connect string that way and the connection test successfully. However, when I try using that same string with ASP, I keep getting a Server Does Exist, or Access Denied error. Here's my connect string:

<%
Option Explicit
Dim strConnection, conn

strConnection = "Provider=SQLOLEDB.1;Password=xxx;Persist Security Info=True;User ID=qdbreports;Initial Catalog=qdb;Data Source=myserver"
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open strConnection

%>

Help! Any suggestions are greatly appreciated.

Dale

 
Old October 30th, 2006, 11:59 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 917
Thanks: 0
Thanked 0 Times in 0 Posts
Default

make a little .vbs script and paste in the code (without the script tags). If it works this way, then your problem is related to the userid of the web site (it doesn't have admin access and you do). But please don't give that userid admin access, but rather find another solution.

If it doesn't work in a .vbs script you need to visit connectionstrings.com.

By the way, I think you have the wrong forum. This is an asp.net forum.

 
Old October 31st, 2006, 10:56 AM
Authorized User
 
Join Date: Jun 2006
Posts: 60
Thanks: 1
Thanked 0 Times in 0 Posts
Default

I'm not familiar with vbs, so I'm not sure what you mean. I'll move this to the ASP Classic forum (is that the correct forum?).

 
Old October 31st, 2006, 05:13 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 917
Thanks: 0
Thanked 0 Times in 0 Posts
Default

yes, that's the right forum. The name of the ASP Script language is "VBScript", and your program should have a .vbs extension if you're not using it in a web page. It's funny that some ASP coders have used it for years in web pages but they don't know they can run it stand-alone. Stand-alone is much easier, and you have a lot of Windows features that are much harder in a web page (like a MsgBox).

Make this file with Notepad, name it "connectTest.vbs", and then double-click on it from Explorer (watch out for line wrap):

--------
Dim strConnection, conn

strConnection = "Provider=SQLOLEDB.1;Password=xxx;Persist Security Info=True;User ID=qdbreports;Initial Catalog=qdb;Data Source=myserver"

' Remove the "Server." in front of CreateObject for use as a stand-alone pgm
Set conn = CreateObject("ADODB.Connection")
conn.Open strConnection

msgbox("it works")
------------------

If you see the "it works" message box, your string is good. If not, you'll see an error after the connect attempt times out. Then you need to modify your string and try again.







Similar Threads
Thread Thread Starter Forum Replies Last Post
'Remote server machine does not exist...' GandolftheWhite Excel VBA 7 September 13th, 2013 09:05 AM
Server Does Not Exist - Connect String Problem dalezjc Classic ASP Basics 6 October 31st, 2006 01:37 PM
Sql Server does not exist mauks SQL Server 2000 3 December 2nd, 2005 03:02 PM
'Remote server machine does not exist..." GandolftheWhite Pro VB Databases 0 November 15th, 2004 12:58 PM
Server doesn't exist or access denied webmist69 SQL Server ASP 7 June 29th, 2004 02:56 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.