MS SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesMS SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 19th, 2004, 03:36 PM
AJP205 AJP205 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 100 AJP205 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 8 h 1 m 32 sec
Reputation Power: 5
Can't connect to DB using ASP

I am trying to connect to a SQL Server 2000 database using VBScript on an active server page, but I can't connect. I think my SQL Server may be set up wrong in the security settings.

I have my authenication set to Windows Authenication Only, and I have an "sa" account with a password.

Here is my code:

Code:

<%
dim objConn
dim sqlCmd
dim FromWebPage as string
FromWebPage = "FromWebPage"

'create connection
objConn = Server.CreateObject("ADODB.Connection")

'connect to the SQL Server db (local machine)
objConn.ConnectionString = "PROVIDER=MSDASQL;DRIVER={SQL Server};SERVER=(local);DATABASE=SteelBoard;UID=sa;PWD=password;"
objConn.Open

sqlCmd = "insert into TestTable (FirstName) values ('" & FromWebPage & "')"

'put data into database
objConn.Execute(sqlCmd)

'close the connection
objConn.Close
objConn = nothing
%>


Reply With Quote
  #2  
Old December 10th, 2004, 07:01 AM
drbhoneydew drbhoneydew is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Location: Harrogate, UK
Posts: 15 drbhoneydew User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
You've actually answered your own question - with authentication set to Windows only, it is never going to allow SQL logins in. Turn SQL and Windows authentication on and all should be well.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMS SQL Development > Can't connect to DB using ASP


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway