更新我设置的查询更改值

时间:2017-03-21 20:31:50

标签: access-vba access

我的代码如下为Access 2010.这是一个简单的密码重置表单。我告诉它要设置密码的方法,但是当我查看表格时,值为" 9.63258661963259E + 44"它将整数更改为小数。为什么会这样?

Option Compare Database

Private Sub cmdPasswordReset_Click()

Dim dbre As Database
Dim qre As QueryDef

Set dbre = CurrentDb
empID = Me.cmbEmpPassChange

sqlString = "Update Employee"
sqlString = sqlString + "SET Password = 963258661963258661963258661963258661963258661 "
sqlString = sqlString + " where ID = " & empID & ";"

dbre.Execute sqlString, dbFailOnError

End Sub

1 个答案:

答案 0 :(得分:0)

这不是小数,而是指数(科学)表示。

但是,将其设置为字符串并括起字段名称,因为它是保留字:

sqlString = sqlString & " SET [Password] = '963258661963258661963258661963258661963258661'"