Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics 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:38 PM
Registered User
 
Join Date: Oct 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default ASP Linking to SQL Server 2000 Dev

I have an issue that when I connecting to my data store. If I connect via SQL Server 2000 Dev I cannot access the file and get a generic 500 error. However using the same code I can connect to my Access, I have set permissions on SQL to allow connections etc.. even set to anonymous and still no connection on SQL. Any ideas?

 
Old October 21st, 2005, 01:58 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

How are you connecting, what is your connection string?
Jim

 
Old October 24th, 2005, 06:51 AM
Registered User
 
Join Date: Oct 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

use your connection string in web config
www.whatusearch.net
www.powerofsearch.net

 
Old October 24th, 2005, 09:01 AM
Registered User
 
Join Date: Oct 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Sorry about that Here is the connection string.

Dim objConn, objRS
Set objConn = Server.CreateObject("ADODB.Connection")
Set objRS = Server.CreateObject("ADODB.Recordset")

Dim strDatabaseType
'Choose one of the following two lines, and comment out the other
'strDatabaseType = "Access"
strDatabaseType = "MSDE"

'Now we use this selection to open the connection in the appropriate way
If strDatabaseType = "Access" Then
  objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
               "Data Source=C:\BeginningASP3\Movie2000.mdb;" & _
               "Persist Security Info=False"

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

End If

 
Old October 24th, 2005, 01:49 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

use a sqlcommand object

dim objSqlConn as New SqlConnection

objSqlConn.ConnectionString = "workstation id=<pc name>;packet size=4096;user id=<id>;initial catalog=<db name>persist security info=True;password=<pw>"

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

Actually there were three things that I needed to do. 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 was initially set as <default> or Windows Authentication only. Finally I had to change the connection string to the following

Else

  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 24th, 2005, 05:20 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

Well you had stated you are using SQL Server 2000 in your original post. Based on that, my code will work. If you are using MySQL, it may be different, I don't know, I have never used it.








Similar Threads
Thread Thread Starter Forum Replies Last Post
Download in Image from Sql Server 2000 using asp surendraparashar Classic ASP Basics 0 December 16th, 2007 11:55 PM
Error in connecting to sql server 2000 using asp method SQL Server 2000 1 March 7th, 2005 11:05 PM
login page in asp.net using sql server 2000 shahzeb ADO.NET 4 December 1st, 2004 06:27 AM
setting up asp web project on a dev server ak ASP.NET 1.0 and 1.1 Basics 13 March 10th, 2004 08:47 AM
SQL Server 2000, ASP and Crystal Report quinn SQL Server ASP 0 March 9th, 2004 02:55 PM





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