拼音字段是字符型的吧
SQL="set * from 配件表 "
set rs=cn.openresult(sql,rdopendynamic,rdconcurvalues)
do while not rs.eof
rs.edit
rs!s拼音=pydmzh(s名称)
rs.update
rs.movenext
loop
可以用
方法1:
SQL="UPDATE 配件表 SET S拼音='" & PyDmZh(sName)& "' WHERE 你所要加的条件"
方法2:
Public Function SaveObject(rsDB As ADODB.Recordset) As Boolean
Dim flag As Boolean
SaveObject = False
flag = False
rsDB.Requery
If Not rsDB Is Nothing Then
If rsDB.RecordCount > 0 Then
On Error GoTo ErrHandle
rsDB.MoveFirst
rsDB.Find "[主键]='" & mstrKey & "'"
If rsDB.EOF Then
flag = True
rsDB.AddNew
End If
Else
rsDB.AddNew
End If
rsDB![标题] = mstrCaption
' rsDB![分类] = mstrFullPath
rsDB![主键] = mstrKey
rsDB![父键] = mstrParentKey
rsDB![类别] = ObjType
rsDB![文件类型] = mlngFileType
rsDB![描述] = IIf(mstrDescription = "", "无", mstrDescription)
rsDB![GUID] = mstrGUID
rsDB![文件大小] = mlngFileSize
rsDB![日期] = IIf(IsNull(mstrDate), Date, mstrDate)
rsDB![外部键] = mstrForeignKey
'rsDB![分类] = "d"
rsDB![删除否] = DeletedFlag '+ Attach a deleted flag
rsDB![所有者] = glngUserID
rsDB![状态] = mvarStatue
'rsDB![属性] = glngUserPower
rsDB![根键] = glngNodeRoot
If Not Trim(mstrFBackupKey) = "" Then
rsDB![外备份键] = mstrFBackupKey
Else
rsDB![外备份键] = GUID_NULL
End If
If Not Trim(mstrPBackupkey) = "" Then
rsDB![父备份键] = mstrPBackupkey
Else
rsDB![父备份键] = GUID_NULL
End If
' If IsNull(rsDB![外备份键]) Then
' rsDB![外备份键] = "无"
' End If
' If IsNull(rsDB![父备份键]) Then
' rsDB![父备份键] = "无"
' End If
rsDB.Update
If rsDB.Status = adRecOK Then
SaveObject = True
End If
End If
Exit Function
ErrHandle:
MsgBox Err.Number & "======" & Err.Description
If Err.Number = -2147217887 Or Err.Number = -2147217864 Then
MsgBox "系统错误,请重新打开数据库", , "错误"