0
我只需要修復一些壞記錄。我可以將年份與年份互換並重新加密。但是,當我嘗試再次將其放入MS SQL SERVER varbinary字段時,它正在被截斷。用新的加密值更新表的正確方法是什麼?我有一個加密的值,爲什麼不會進入varbinary字段?
Conn.Open strDSN
Dim sql : sql = "Select * FROM tmpRefill WHERE CC <> 'NULL' AND CustId = 9944"
rs.Open sql, Conn
Dim custId, email, cc, newCC, upSQL
Do Until rs.EOF
Response.Write rs("CustId")
Response.Write("<br />")
Response.Write rs("email")
Response.Write("<br />")
cc = EnCrypt(rs("CC"))
Response.Write cc
Response.Write("<br />")
cc = Split(cc,"-")
newCC = cc(0) & "-" & cc(2) & "-" & cc(1) & "-" & cc(3)
Response.Write newCC
Response.Write("<br />")
newCC = EnCrypt(newCC)
Response.Write newCC
Response.Write("<br />")
Response.Write("<br /><br />")
rs.MoveNext
Loop
upSQL = "UPDATE tmpRefill SET CC = CONVERT(VARBINARY(500), '" & newCC & "') WHERE CustId = 9944"
Conn.Execute (upSQL)
表列上的數據類型是varbinary(500),所以我不明白爲什麼我必須將其轉換爲插入它。