November 26, 2002 at 2:57 pm
Hi,
My developers are off today. I hope you can do this very quick. I need to create an ASP file that uses SSPI authentication connecting to a SQL box named DB1. Once connected it will issue SELECT CustomerID FROM Northwind..Orders
and display the result in the browser. To make it simple, I want to have an ASP file that when I open it in IE I will see the result of SELECT CustomerID FROM Northwind..Orders; given server name = DB1.
Thx.
November 26, 2002 at 5:30 pm
Set dkrConnection = Server.CreateObject("ADODB.Connection")
Set dkrResult = Server.CreateObject("ADODB.Recordset")
dkrConnString = Application("driver=SQL Server;server=db1\steve;database=northwind")
dkrConnection.Open dkrConnString
dkrQuery = "select * from orders"
' Execute the query
dkrResult.Open dkrQuery, dkrConnection
if not dkrResult.EOF then
response.write(dkrResult.fields("customerid").value)
dkrResult.movenext
end if
set dkrResult = Nothing
set dkrConnection = Nothing
Steve Jones
November 27, 2002 at 3:39 am
Will only display first row
do until dkrResult.EOF
response.write(dkrResult.fields("customerid").value)
dkrResult.movenext
loop
will show all rows
Far away is close at hand in the images of elsewhere.
Anon.
November 27, 2002 at 8:14 am
I prefer
while not dkrResult.EOF
response.write(dkrResult.fields("customerid").value)
dkrResult.movenext
wend
November 27, 2002 at 12:15 pm
thx everyone.
Happy Turkey.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply