ASP½«²éѯÊý¾Ýµ¼³öEXCEL
Ò»¡¢ÓÃOWC
ʲôÊÇOWC£¿
¡¡¡¡OWCÊÇOffice Web CompentµÄËõд£¬¼´MicrosoftµÄOffice Web×é¼þ£¬ËüΪÔÚWebÖлæÖÆÍ¼ÐÎÌṩ
ÁËÁé»îµÄͬʱҲÊÇ×î»ù±¾µÄ»úÖÆ¡£ÔÚÒ»¸öintranet»·¾³ÖУ¬Èç¹û¿ÉÒÔ¼ÙÉè¿Í»§»úÉÏ´æÔÚÌØ¶¨µÄä¯ÀÀÆ÷ºÍÒ»
Щ¹¦ÄÜÇ¿´óµÄÈí¼þ£¨ÈçIE5ºÍOffice 2000£©£¬ÄÇô¾ÍÓÐÄÜÁ¦ÀûÓÃOffice Web×é¼þÌṩһ¸ö½»»¥Ê½Í¼Ðοª
·¢»·¾³¡£ÕâÖÖģʽÏ£¬¿Í»§¶Ë¹¤×÷Õ¾½«ÔÚÕû¸öÈÎÎñÖзֵ£ºÜ´óµÄ±ÈÖØ¡£
ÓйصÄÏêϸ½éÉÜÒ²¿ÉÔÚ±¾Õ¾ÕÒµ½¡£
<%Option Explicit
Class ExcelGen
Private objSpreadsheet
Private iColOffset
Private iRowOffset
Sub Class_Initialize()
Set objSpreadsheet = Server.CreateObject("OWC.Spreadsheet")
iRowOffset = 2
iColOffset = 2
End Sub
Sub Class_Terminate()
Set objSpreadsheet = Nothing 'Clean up
End Sub
Public Property Let ColumnOffset(iColOff)
If iColOff > 0 then
iColOffset = iColOff
Else
iColOffset = 2
End If
End Property
Public Property Let RowOffset(iRowOff)
If iRowOff > 0 then
iRowOffset = iRowOff
Else
iRowOffset = 2
End If
End Property Sub GenerateWorksheet(objRS)
'Populates the Excel worksheet based on a Recordset's contents
'Start by displaying the titles
If objRS.EOF then Exit Sub
Dim objField, iCol, iRow
iCol = iColOffset
iRow = iRowOffset
For Each objField in objRS.Fields
objSpreadsheet.Cells(iRow, iCol).Value = objField.Name
objSpreadsheet.Columns(iCol).AutoFitColumns
'ÉèÖÃExcel±íÀïµÄ×ÖÌå
objSpreadsheet.Cells(iRow, iCol).Font.Bold = True
objSpreadsheet.Cells(iRow, iCol).Font.Italic = False
objSpreadsheet.Cells(iRow, iCol).Font.Size = 10
objSpreadsheet.Cells(iRow, iCol).Halignment = 2 '¾ÓÖÐ
iCol = iCol + 1
Next 'objField
'Display all of the data
Do While Not objRS.EOF
iRow = iRow + 1
iCol = iColOffset
For Each objField in objRS.Fields
If IsNull(objField.Value) then
objSpreadsheet.Cells(iRow, iCol).Value = ""
Else
objSpreadsheet.Cells(iRow, iCol).Value = objField.Value
objSpreadsheet.Columns(iCol).AutoFitColumns
objSpreadsheet.Cells(iRow, iCol).Font.Bold = False
objSpreadsheet.Cells(iRow, iCol).Font.Italic = False
objSp
Ïà¹ØÎĵµ£º
<%
'1¡¢´´½¨EXCEL¶ÔÏñ
set objExcelApp = CreateObject("Excel.Application")
objExcelApp.DisplayAlerts = false '²»ÏÔʾ¾¯¸æ
objExcelApp.Application.Visible = false '²»ÏÔʾ½çÃæ
'2¡¢ н¨ExcelÎļþ
objExcelApp.WorkBooks.add
set objExcelBook = ob ......
1,Q:ÔõÑù°Ñ±ðÈËÍøÒ³Éϵı³¾°ÒôÀÖ±£´æÏÂÀ´?
A:ä¯ÀÀ¸ÃÍøÒ³ºó,ÔÚÄãµÄ Windows\Temporary Internet Files Îļþ¼ÐÏ¿ÉÒÔÕÒµ½¸Ã±³¾°ÒôÀֵĻº´æÎļþ£¬¿½±´³öÀ´¼´¿ÉʹÓá£Èç¹û»¹ÊÇÕÒ²»¼û¸ÃÎļþ£¬¿ÉÒÔ´ò¿ªÍøÒ³µÄÔ´Îļþ£¬ÕÒµ½ÒôÀÖÎļþµÄ URL ·¾¶£¬ÓÓÂìÒÏ”µÈ FTP Èí¼þ½øÐÐÏÂÔØ¡£
2,Q:±ÜÃâÓ ......
asp Http_Referer,Server_NameºÍHttp_Host
ÒÔǰ¸Ð¾õRequest.ServerVariablesÀïµÄÖµºÜ¶à£¬ÏÖÔÚ¿´¿´»¹ÊÇÄÇô¶à£¬²»¹ý½ñÌì̸ÆäÖеÄÒ»¸öÖµ----HTTP_RefererÒÔ¼°Request.ServerVariablesÀïServer_NameÓëHttp_HostÖ®¼äÓÐÊ²Ã´Çø±ðÄØ£¿
¸Õ²ÅÔËÐÐÁËÒ»¶Î´úÂ룬À´²é¿´Request.ServerVariablesÀïÃæÓжàÉÙÖµ£¬¿´ÁËһϣ¬¹²50¸ö£¡
´úÂ ......
ASP+AccessÊý¾Ý¿âµÄ18Ìõ°²È«·¨Ôò£º
1.Ê×ÏÈ£¬ÎÒÃÇÐèÒª¹ýÂËËùÓпͻ§¶ËÌá½»µÄÄÚÈÝ,ÆäÖаüÀ¨?id=NÒ»Àà,ÁíÍ⻹ÓÐÌá½»µÄhtml´úÂëÖеIJÙ×÷Êý¾Ý¿âµÄselect¼°aspÎļþ²Ù×÷Óï·¨,´ó¼Ò¿ÉÒÔ°ÑÌá½»µÄ×Ö·ûתÒå,È»ºóÔÙ´æÈëÊý¾Ý¿â¡£
2.È»ºóÐèÒª¶Ô·ÃÎÊAccessÊý¾Ý¿âµÄÒ³Ãæ½øÐÐÊÚȨ,Õë¶ÔÏÔʾÊý¾ÝÒ³ÃæÖ»ÄÜʹÓÃselectÓï¾ä,¹ýÂËÆäËûµÄupdate,asp ......