|
楼主 |
发表于 2009-10-15 07:44:04
|
显示全部楼层
本帖最后由 cjzsun 于 2009-10-15 09:25 编辑
www.lodoeshop.com免费版
可能与程序无关, access导出成excel时正确, 从excel再导入access时商品描述字段丢失大部分内容.
免费版数据库需要解密, 商品表为lodo_Goods
access数据库解密办法:
解密方法如下:拷以下代码另存为JIEMI.asp
<%
Option Explicit
If Request.Form <> "" Then Call Coding()
Sub Coding()
Dim strDBName, strDBFullPath, strTmpDBFullPath, strCoding, strSql
Dim objFso, objEngine
strDBName = Trim(Request.Form("dbname"))
strDBFullPath = Server.MapPath(strDBName)
strTmpDBFullPath = strDBFullPath & ".tmp"
strCoding = Request.Form("coding")
Set objFso = Server.CreateObject("Scripting.FileSystemObject")
If objFso.FileExists(strDBFullPath) Then
Set objEngine = Server.CreateObject("JRO.JetEngine")
Select Case strCoding
Case "decode"
objEngine.CompactDatabase "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDBFullPath, "Provider=Microsoft.Jet.OLEDB.4.0;Jet OLEDB:Database Password="& GetBinaryPass &";Data Source=" & strTmpDBFullPath
Case "uncode"
objEngine.CompactDatabase "Provider=Microsoft.Jet.OLEDB.4.0;Jet OLEDB:Database Password="& GetBinaryPass &";Data Source=" & strDBFullPath , "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strTmpDBFullPath
End Select
Set objEngine = Nothing
objFso.CopyFile strTmpDBFullPath, strDBFullPath
objFso.DeleteFile strTmpDBFullPath
Set objFso = Nothing
If Err Then
Response.Write "<div style=""font-weight:bold; color:#FF0000"">操作失败,请调试。</div>"
Else
If strCoding = "decode" Then
Response.Write "<div style=""font-weight:bold; color:#FF0000"">数据库加密成功。</div>"
Else
Response.Write "<div style=""font-weight:bold; color:#FF0000"">数据库解密成功。</div>"
End If
End If
Else
Set objFso = Nothing
Response.Write "<div style=""font-weight:bold; color:#FF0000"">数据库名称或路径不正常,操作取消。</div>"
End If
End Sub
Function GetBinaryPass()
Dim PassUrl
Dim objStream
Dim Password, PasswordStr
PassUrl = Server.MapPath(".") & "\wwwlodocom"
Set objStream = Server.CreateObject("ADODB.Stream")
objStream.Open
objStream.Type = 1
objStream.LoadFromFile PassUrl
PasswordStr = objStream.Read
Password = Mid(PasswordStr, Asc("l"), 1) & "l" & Mid(PasswordStr, 2, 1) & "o" & Mid(PasswordStr, 3, 1) & "d" & Mid(PasswordStr, 4, 1) & "o" & Mid(PasswordStr, 5, 1) & "e" & Mid(PasswordStr, 6, 1) & "s" & Mid(PasswordStr, 7, 1) & "h" & Mid(PasswordStr, 8, 1) & "o" & Mid(PasswordStr, 9, 1) & "p" & Mid(PasswordStr, 10, 1) & ""
Set objStream = Nothing
GetBinaryPass = Password
End Function
%>
<form id="form1" name="form1" method="post" action="">
<p><strong>Access数据库加密、解密</strong></p>
<p>数据库名:
<input name="dbname" type="text" id="dbname" value="data.mdb" />
</p>
<p>操作方向:
<input name="coding" type="radio" value="decode" />
加密
<input type="radio" name="coding" value="uncode" />
解密 </p>
<p>
<input type="submit" name="Submit" value="执行" />
</p>
<p>请将此文件,乐度数据库及inc/wwwlodocom放在具有读写权限的同一目录下执行</p>
</form> |
|