我用VB6.0编程,已连接sql server数据库(Selectsqlbd2),需要向数据表Pub_Exam添加或更新数据,在添加时,表中字段Exam_GUID不能为空,而且估计是自动生成的(过往数据是很长的一串类似16进制代码,如17A60D12-63DF-4CC6-9A02-C6EE3002A3AB),我应该如何操作呢。以下为VB6代码。(是vb6.0,不是vb.net,选项里没有vb6)
Dim SQL As String
SQL = "select * from Pub_Exam where Exam_HisCode='" & Exam_HisCode & "'"
Set rrsbd2 = Selectsqlbd2(SQL)
If rrsbd2.EOF = True Then
rrsbd2.AddNew
rrsbd2("Exam_HisCode") = Exam_HisCode
rrsbd2("Pat_Name") = Pat_Name
rrsbd2("Pat_Sex") = Pat_Sex
Exam_GUID这里不知道如何写!
Else
rrsbd2("Pat_Name") = Pat_Name
rrsbd2("Pat_Sex") = Pat_Sex
End If
rrsbd2.Update
MsgBox "报告数据推送机构服务器成功!", 0 + 64, "提示 "
Exit Sub