标签
标签 ‘Asp’ 的存档
使用 AdoX.Catalog重命名access的表
2008年12月11日
Dim Conn,ConnStr,oCat,oTbl
ConnStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("data.mdb")
Set oCat=Server.CreateObject("ADOX.Catalog")
oCat.ActiveConnection = ConnStr
Set oTbl = Server.CreateObject("ADOX.Table")
Set oTbl = oCat.Tables("OldTable") ‘要重命名的表名:OldTable
oTbl.Name = "NewTable" ‘新表名
Set oCat = Nothing
Set oTbl = Nothing
SQL SERVER 重命名
sp_rename ‘old_name’, ‘new_name’, ‘object’
阅读全文 ]ASP + SQL SERVER 存储过程不完全攻略
2008年12月11日
<%@Language="VBSCRIPT" CodePage="936" LCID="2052"%>
<%Option Explicit%>
<%
‘**********************************************
‘ Coding By DeltaCat [...]
阅读全文 ]Asp + Access 数据库事务 的例子
2008年12月10日
数据库事务,不用哆嗦了,但它并不是ORACLE,SQL SERVER 这些大中型数据库的专利,ACCESS数据库也支持的
<%@Language = "VBSCRIPT" CodePage = "936"%> <%Option Explicit%> <% ' global variables Dim cn ' self functions Sub DBCon Dim access_Path access_Path = Server.MapPath("db1.mdb") Set cn = Server.CreateObject("ADODB.Connection") cn.Provider = "Microsoft.JET.OLEDB.4.0" cn.Open "Data Source=" & access_Path End Sub ...
阅读全文 ]php,asp以"流格式"下载服务器端文件, 解决WORD,EXCEL,TXT,图片等文件类型直接在IE中被打开的问题
2008年12月10日
一、PHP格式
<?php function downFileFromServer($showFileName, $downFilePath) { if(file_exists($downFilePath)) { if(is_readable($downFilePath)) { if(Trim($showFileName) == '') { $showFileName = 'undefined'; }
….
[
阅读全文 ]Asp + Excel 操作大全
2008年12月10日
一. OLEDB方式
<%@Language="VBSCRIPT" CodePage="936"%> <%Option Explicit%> <html> <head> <title>EXCEL Speed Test</title> <style> body,p{font-family:"Tahoma";font-size:"8pt"} </style> </head> <body> <% Dim time_start, time_end Dim xls, conStr time_start = timer() Set xls = Server.CreateObject("ADODB.Connection") xls.Provider = "Microsoft.JET.OLEDB.4.0" xls.CursorLocation = 3 conStr = "Data Source=" & Server.MapPath("test.xls") & ";Extended Properties=Excel 8.0;" On Error Resume Next xls.Open conStr If Err.Number <> 0 Then response.Write(Err.Description) Err.Clear response.End End If Dim rs, i Set rs = Server.CreateObject("ADODB.Recordset") rs.Open "SELECT * FROM ['sheet1$']", xls, 1, 1, 1 If rs.Eof And rs.Bof Then Else Dim fc fc = rs.Fields.Count For i = 0 To fc - 1 response.Write(rs.Fields(i).Name) response.Write("|") Next response.Write("<BR><BR>") Do While Not rs.Eof If request.IsClientConnected Then For i = 0 To fc - 1 response.Write(rs(i).Value) response.Write("|") Next response.Write("<BR>") rs.MoveNext Else Exit Do End If Loop End If rs.Close xls.Close Set rs = nothing Set xls = nothing response.Write("<BR>") response.Write("<hr>") response.Write("<p align='center'>") time_end = timer() response.Write("页面执行时间: ") response.Write(FormatNumber((time_end - time_start)*1000, 2)) response.Write(" 毫秒</p>") %> </body> </html> <% response.End %>
…….
[
阅读全文 ]
