Office中国论坛/Access中国论坛
标题:
怎样才能给GUID字段赋值?(有没更好看点的方式)
[打印本页]
作者:
lanchong
时间:
2008-4-21 16:38
标题:
怎样才能给GUID字段赋值?(有没更好看点的方式)
Str2DataTB6 = "SELECT dbo_ACPUB.* FROM dbo_ACPUB"
Dim Rst2INVMB2 As New ADODB.Recordset
Rst2INVMB2.Open Str2DataTB6, CurrentProject.Connection, adOpenKeyset, adLockOptimistic
Rst2INVMB2.AddNew
Rst2INVMB2("AUTOMID") = Form_FmACPu02.AUTOID
' 这句通不过
Rst2INVMB2.Update
Rst2INVMB2.Close
Set Rst2INVMB2 = Nothing
Form_FmACPu02.AUTOID本身是自动编号的同步复制 ID,我想把他抄入ACPUB表AUTOMID字段(数字的同步复制 ID),但怎么都通不过
要怎么写才行啊?
俺的楼下方法太难看了,有没其他简单一点的写法?
[
本帖最后由 lanchong 于 2008-4-21 16:58 编辑
]
作者:
lanchong
时间:
2008-4-21 16:56
对ACCESS的方式无以理解
strSQL = "SELECT dbo_ACPUB.* FROM dbo_ACPUB WHERE (((dbo_ACPUB.AUTOMID) = " & StringFromGUID(Form_FmACPu02.AUTOID) & "))"
没有问题
Rst2INVMB2("AUTOMID") = Form_FmACPu02.AUTOID
Rst2INVMB2("AUTOMID") = StringFromGUID(Form_FmACPu02.AUTOID)
都通不过
Rst2INVMB2("AUTOMID") = Mid(StringFromGUID(Form_FmACPu02.AUTOID), 7, Len(StringFromGUID(Form_FmACPu02.AUTOID)) - 7)
看着都吐血的方式通过了[:31] [:31] [:31]
欢迎光临 Office中国论坛/Access中国论坛 (http://www.office-cn.net/)
Powered by Discuz! X3.3