The following is code from an asp page…using ADO to ascess domino server…hooks into the database, finds the database specified in the If condition, grabs the specified view and works from there. Then establishes Excel session and writes HTML to it using excel commands…populating it with the data from domino. I get the column headings properly, but then this line: Set docX = v.GetFirstDocument
Returns "Cannot write or create file (file or disk is read-only) (All)
Has anyone any recourse that would allow this object to be accessed similarly so that I do not have to re-write the whole thing from that point on? Thanks.
<%
Response.Buffer = True
Response.ContentType=“application/vnd.ms-excel”
Dim s
Set s = CreateObject(“Lotus.NotesSession”)
Call s.InitializeUsingNotesUserName(“Internet Access”)
Dim dir
Dim db
Set dir = s.GetDbDirectory(“”)
Set db = dir.GetFirstDatabase(1247)
'Response.Write(“Example of Microsoft IIS using ASP to access Domino Objects”) & “
” & “
”
'Response.Write(“Below is a listing of all databases stored on my local data directory”) & “
” & “
”
While Not (db Is Nothing)
'Response.Write(" Database Title:" & " " & db.Title) & " " & Response.Write(" Path:" & " " & db.FilePath)& “
”
If db.Title = “ECR Tracking” Then
db.Open
View=“All”
Set v = db.GetView(View)
col=1
Response.Write("<Table border>")
lineitem=""
For Each vColumn In v.Columns
If col=1 Then
lineitem = Response.Write("<th align='center'><FONT SIZE=3 COLOR='0000FF'>" & vColumn.Title)
Else
lineitem = lineitem & Response.Write("<th align='center'><FONT SIZE=3 COLOR='0000FF'>" & vColumn.Title)
End If
col=col+1
Next
lineitem=lineitem
Set docX = v.GetFirstDocument
lineitem=""
While Not docX Is Nothing
col=1
For Each cValue In docX.ColumnValues
If col=1 Then
lineitem= Response.Write("<tr>")
End If
If cValue="" Then 'blank value still formats the cell
lineitem=lineitem & Response.Write("<td> </td>")
Elseif Isdate(cValue) Then 'date format
lineitem=lineitem & Response.Write("<TD ALIGN='right' STYLE='vnd.ms-excel.numberformat:dd-mmm-yyyy'>+cValue+</td>")
Elseif Isnumeric(cValue) Then
If (v.columns(col-1).numberformat=3) Then 'currency format
lineitem=lineitem & Response.Write("<td ALIGN='right' STYLE='vnd.ms-excel.numberformat:$#,##0.00'>+cValue+</td>")
Else 'other number format
lineitem=lineitem & Response.Write("<td ALIGN='right'>+cValue+</td>")
End If
Else 'Plain text format
lineitem=lineitem & Response.Write("<td>+cValue+</td>")
End If
col=col+1
Next
Response.Write(lineitem & "</tr>")
Set docX=v.GetNextDocument(docX)
Wend