Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.0 and 1.1 Basics
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 20th, 2005, 04:38 PM
Registered User
 
Join Date: Oct 2005
Location: , , .
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?

  #2 (permalink)  
Old October 21st, 2005, 01:58 PM
Friend of Wrox
Points: 4,332, Level: 27
Points: 4,332, Level: 27 Points: 4,332, Level: 27 Points: 4,332, Level: 27
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2003
Location: , NJ, USA.
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

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

  #3 (permalink)  
Old October 24th, 2005, 06:51 AM
Registered User
 
Join Date: Oct 2005
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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

  #4 (permalink)  
Old October 24th, 2005, 09:01 AM
Registered User
 
Join Date: Oct 2005
Location: , , .
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

  #5 (permalink)  
Old October 24th, 2005, 01:49 PM
Friend of Wrox
Points: 4,332, Level: 27
Points: 4,332, Level: 27 Points: 4,332, Level: 27 Points: 4,332, Level: 27
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2003
Location: , NJ, USA.
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>"

  #6 (permalink)  
Old October 24th, 2005, 02:40 PM
Registered User
 
Join Date: Oct 2005
Location: , , .
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 :)

  #7 (permalink)  
Old October 24th, 2005, 05:20 PM
Friend of Wrox
Points: 4,332, Level: 27
Points: 4,332, Level: 27 Points: 4,332, Level: 27 Points: 4,332, Level: 27
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2003
Location: , NJ, USA.
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.



 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 03:14 AM.


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