Visual Interdev - ASP on SQL SVR viewing Viariable

Results 1 to 3 of 3

Thread: Visual Interdev - ASP on SQL SVR viewing Viariable

  1. #1
    Patti Guest

    Default Visual Interdev - ASP on SQL SVR viewing Viariable

    I&#039m not a sophisticated programmer, but I&#039ve been given a challenge.<BR>I&#039m 2/3 there but this last part isn&#039t working for me.<BR><BR>I was given a flat file that I imported into SQL Server. The file contains customer information and the path and filenames where the associated spread sheet is that contains MORE information.<BR><BR>Using ADO and Forms I created a form that the customer plugs the specific information; it hits the database and writes the request back that it got from the SQL database, include the path and filename of the Excel Spread Sheet on a different server that contains MORE information. (with a string that confirmed it hit the database)<BR><BR>Now I want them to be able to click a Confirmation button OR SOMETHING and launch the path and filename (almost like a variable hyperlink) to pull up the excel spread sheet they were looking for.<BR>When I use GetObject("Excel.Application")or GetFile (wrong method) it errors out. I tried Dim .... and DIM ...AS and VAR and they all error out. is there a way to do this from VID with ASP?<BR>

  2. #2
    Patti Guest

    Default Here's the code, Can't call a URL with .XL

    &#039dim variables to store form contents<BR>Dim strcenter,strplcyrgnl,strplcysmbl,strplcynbr,strpa th,strfilename<BR><BR>&#039read form and save in variable to save reading again later<BR>strCenter = request.form("txtcenter")<BR>strplcyrgnl = request.form("txtplcyrgnl") <BR>strplcysmbl = request.form("txtplcysmbl") <BR>strplcynbr = request.form("txtplcynbr")<BR>strpath = Request.Form("txtpath")<BR>strfilename = Request.Form("txtfilename")<BR><BR>dim cn &#039connection<BR>dim rs &#039recordset<BR>dim cmd &#039command<BR><BR>set cn = Server.CreateObject("ADODB.Connection")<BR>set rs = Server.CreateObject("ADODB.Recordset")<BR>set cmd = server.CreateObject("ADODB.Command")<BR><BR>cn.Ope n "Provider=SQLOLEDB.1;UID=sa;DATABASE=Paris-UW;"<BR><BR>strsql = "SELECT * FROM awksfd823 "<BR>strsql = strsql & "WHERE orig_ctr = &#039" & strcenter & "&#039 "<BR>strsql = strsql & "AND rgnl_cd = &#039" & strplcyrgnl & "&#039 "<BR>strsql = strsql & "AND plcy_smbl = &#039" & strplcysmbl & "&#039 "<BR>strsql = strsql & "AND plcy_nbr = &#039" & strplcynbr & "&#039 "<BR><BR>rs.Open strsql, cn<BR><BR>if rs.EOF then<BR> Response.Write "No Record Found, Please Click Back and Try Again" & "<BR>"<BR>else<BR> Response.Write "&#060;STRONG&#062;&#060;FONT COLOR=&#039black&#039&#062;" & "Please Confirm This IS The Policy You Requested:" &"&#060;/FONT&#062;&#060;/STRONG&#062;<BR>" <BR> Response.Write "Originating Center: " & rs.Fields("orig_ctr") & "<BR>"<BR> Response.Write "Regional Office: " & rs.Fields("rgnl_cd") & "<BR>"<BR> Response.Write "Policy Symbol: " & rs.Fields("plcy_smbl") & "<BR>"<BR> Response.Write "Policy Number: " & rs.Fields("plcy_nbr") & "<BR>"<BR> Response.Write rs("path").value & "\" & rs("filename").value & "<BR>"<BR> <BR> <BR>end if<BR><BR><BR>&#039close connection<BR>rs.Close<BR>cn.Close<BR>set rs = nothing<BR>set cn = nothing<BR><BR><BR><BR><BR>%&#062;<BR>

  3. #3
    Joel N Guest

    Default RE: Visual Interdev - ASP on SQL SVR viewing Viari

    Are you running a web server on the "other" server where the Excel spreadsheet is located?<BR><BR>If you aren&#039t then you&#039ll have to make a directory on THAT server a virtual directory on your web server. NOT a good idea but it can be done with UNC paths or by doing a NET USE (ugggh) between the two machines.<BR><BR>If you&#039re running a web server on the other server just write out a hyperlink to the address of the spreadsheet and when the user clicks on it they&#039ll either have an opportunity to download the file and launch Excel (Netscape users) or it will open automatically (IE users) in their browser. Of course this is assuming the user has Excel on their machine which begs the question why would they want to download a spreadsheet if they didn&#039t have the application necessary to open it in the first place.<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts