|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
||||
|
||||
|
Hi,
please don't double post, have a look at your other thread ![]() http://forums.aspfree.com/t59523/s.html
__________________
Look! Its a ShemZilla ![]() ![]()
|
![]() |
| Viewing: ASP Free Forums > Database > Microsoft SQL Server > Connection to SQL |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|