Microsoft SQL Server
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseMicrosoft SQL Server

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 ASP Free Forums Sponsor:
  #1  
Old May 10th, 2005, 08:43 AM
jacksonbilly jacksonbilly is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 13 jacksonbilly User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Connection to SQL

Hi. I am trying to create a web page that has a drop down menu in which it retrieves data from our SQL server. Maybe this is a bit more simple than I am making it but I am really pulling my hair out trying to get this right. If anyone can help I would greatly appreciate it. The code I have is this:

<% @language = javascript%>
<%
var cnn = Server.CreateObject("ADODB.Connection");
cnn.open "PROVIDER=SQLOLEDB;DATA SOURCE=SQLSRVR;INITIAL DATABASE=ARTPROD;integrated security=SSPI;"
%>

<%
var record = Server.CreateObject("ADODB.Recordset");
var SQLstr = "SELECT proj FROM av_project WHERE pc12 = 'active' ORDER BY proj";
record.Open(SQLstr, record);
%>

<%
record.Close();
record = null;
%>

<select name=records SIZE="3">

<%
while (!record.EOF){
%>

<option value="<%=record("proj")%>"><%=record("proj")%> </option>

<%record.MoveNext();
}%>

</select>

<%
connection.Close();
%>


Our server's name is SQLSRVR and the database I am trying to access is ARTPROD. I have an access database that uses SSPI as security and it works fine. Though online examples show using USERNAME and PASSWORD. I have tried using these instead of integrated security but nothing. The results I get out of the above code is a list box with "> as the contents.

If anybody can tell me where I'm going wrong I would appreciate it.

Thanks,

George

Reply With Quote
  #2  
Old May 10th, 2005, 09:47 AM
nofriends's Avatar
nofriends nofriends is offline
Senior Water Wizard
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Aug 2004
Location: Cape Town, RSA
Posts: 10,186 nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)nofriends User rank is Brigadier General (60000 - 70000 Reputation Level)  Folding Points: 106940 Folding Title: Super Ultimate Folder - Level 1Folding Points: 106940 Folding Title: Super Ultimate Folder - Level 1Folding Points: 106940 Folding Title: Super Ultimate Folder - Level 1Folding Points: 106940 Folding Title: Super Ultimate Folder - Level 1Folding Points: 106940 Folding Title: Super Ultimate Folder - Level 1Folding Points: 106940 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 2 Weeks 2 Days 7 h 36 m 24 sec
Reputation Power: 699
Hi,
please don't double post, have a look at your other thread
http://forums.aspfree.com/t59523/s.html
__________________
Look! Its a ShemZilla



Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft SQL Server > Connection to SQL


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 5 hosted by Hostway
Stay green...Green IT