This works for me:
objRequest =
System.Net.HttpWebRequest.Create("
http://myserver.com/sales/oldsystemreport.
asp?User=" & Session("User") & "&Yr=" & Request.QueryString("yr") & "&Rpt="
& sRpt & "&P=" & Session("Permission") & "&T=" &
cmbTerritory.SelectedItem.Value & "&O=" & cmbGroup.SelectedItem.Value &
"&R=" & cmbRegion.SelectedItem.Value & "&Chan=" & Chan & "&sSoldto=" &
ssoldto & "&sShipto=" & J6shipto & "&J7Periodselect=" & J7Period & "&J7Opt="
& J7Option & "&LC=" & J6lawcon & "&msoldto=" & msoldto & "&BA=" & xBA &
"&RG=" & xRG & "&FC=" & xFC & "&SC=" & xSC)
'objRequest.Credentials = New NetworkCredential("sql", "sql", "REMINGTON")
objRequest.Credentials = New NetworkCredential("username", "password",
"domain")
objResponse = objRequest.GetResponse()
Dim sr As New StreamReader(objResponse.GetResponseStream())
result = sr.ReadToEnd()
iLength = Len(result)
' commented out to debug 03/27/03
''''If InStr(result, "No records matched") > 0 Then
'''' result = "<br>No Records Matched <br>"
''''Else
'''' If sRpt = "Samples" Then
'''' Dim sb As New StringBuilder()
'''' sb.Append("<table border=""9"" ")
'''' iBegin = InStr(result, sb.ToString)
'''' Else
'''' iBegin = InStr(result, "<td><table border=")
'''' End If
'''' 'iBegin = InStr(result, "<td><table border=")
'''' '<table border="9" align="left"
'''' Dim iend = InStr(result, "<p><small>The report ran")
'''' result = Mid(result, iBegin, (iLength - ((iLength - iend) + iBegin)))
'''' result = result.Replace("<td><table border=""9"" align=""left""",
"<td><table border=""9"" align=""center""")
'''' 'result = "<align=""center"">" & result
''''End If
MyPage.Text = result
Button1.Visible = False
The commented code is out for debugging purposes, but I call an asp page
that parses out the stuff I call it with, and calls a stored procedure.
SC