Wrox Programmer Forums
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP 3.0 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 20th, 2005, 04:54 PM
Registered User
Join Date: Oct 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Cannot Connect to SQL Server

I was able to get the Access side of this to work without any problems. However I could not get it to access in SQL. I am using SQL Server 2000 sp4 Dev. I have set the permissions on sa and even tried using the anonymous login and still only recieved error 500.

Dim strDatabaseType
'strDatabaseType = "Access"
strDatabaseType = "MSDE"

If strDatabaseType = "Access" Then
  objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
               "Data Source=C:\BeginningASP3\Movie2000.mdb;" & _
               "Persist Security Info=False"

   objConn.Open = "Provider=SQLOLEDB;Persist Security Info=False;" & _
                "User Id=sa;pwd=CBR600rr;Initial Catalog=Movie;" &_
              "Data Source=C:\Program Files\Microsoft SQL Server\MSSQL\DATA\Movie2000SQL.mdf"

End If

Old October 24th, 2005, 02:45 PM
Registered User
Join Date: Oct 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts

I have Resolved this issue with the following.

First I had to setup the OLEDB in windows for SQL via the Administrative tools, second I had to go into the registry and reset the Authentication type as mixed for MYSQL, it was initially set as <default> or Windows Authentication only. Finally I had to change the connection string to the following


  objConn.Open "Provider=SQLOLEDB;Data Source=<server>;Initial Catalog=Movie2000SQL;User Id=<Name>; Password=<Password>;"

End If
<server> = name of server in SQL
<name><password> = user defined name and password

I do appreciate the help though :)

Old October 25th, 2005, 10:27 AM
JLo JLo is offline
Registered User
Join Date: Oct 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts

Hi Josh,

I'm going through the Beginning ASP 3.0 book at the mo, and i'm well stuck.

I can see you've had people write in about this problem before unfortunately the suggestions and help answers given don't get me any further so i've come to you.

Chapter 12 page 475, where you make your first connection to a SQL data store. I want to use the SQL connection rather than the Access one but the connection string in the book code is just wrong. When i setup an instance of MSDE it needs a password. Even if i put 'setup BLANKSAPWD=1' at the command prompt to make a password-free instance it still doesn't work.

It looks like you've figured it out from your last post but the stuff about first setting up OLEDB for SQL through admin tools can't figure out.

I need the following hand-holding:

      1. Exactly what should i type in at the command prompt to create my
      2. Where should i place the database (MovieMSDE.mdf) file.
      3. Exactly what should i type as the connection string in the file
         Connect.asp where it currently reads:

                objConn.Open "Provider=SQLOLEDB;Persist Security Info=False;" & _
                      "User ID=sa;Initial Catalog=Movie;" & _
                      "Initial File Name=C:\MSSQL7\Data\Movie2000.mdf"

Thanks in advance cos this is doing my nut in.

Aaagh F***ing Computer!

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to connect to a remote SQL Server? mizimizi SQL Server 2000 3 July 4th, 2006 01:47 PM
connect sql-server with c# technorakesh C# 1 April 22nd, 2006 08:09 AM
Cannot connect to SQL server tsimsha SQL Server ASP 1 July 22nd, 2005 07:21 AM
How to connect to SQL SERVER Wizard VB Databases Basics 1 February 5th, 2005 11:29 AM
[000] Unable to connect to server 'SERVER\SQL'; SQ ctanchan SQL Server 2000 1 August 15th, 2003 07:18 AM

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