Hello...What I am trying to do is add records to a SQL table with VB ADO recordset. One of the values I need to add is a uniqueidentifier. I know how to do it in T-SQL but I have been unsuccssful in VB-ADO. All help is appreciated.....Below is a sample of my code...
Private Sub cmdaddsvr_Click()
Set cnsvr = New ADODB.Connection
Set svradd = New ADODB.Recordset
cnsvr.Open "serverdb", "svruser", "svruser"
Set newguid = uniqueidentifier
Set newguid = NEWID()
inputstr = InputBox("Enter Server Name"
svradd.Open "Master", cnsvr, adOpenKeyset, adLockOptimistic, adCmdTable
svradd.Fields("Servername"
.Value = inputstr
svradd.Fields("svrguid"
.Value = NEWID()
svradd.Update
svradd.Close
End Sub
Private Sub cmdaddsvr_Click()
Set cnsvr = New ADODB.Connection
Set svradd = New ADODB.Recordset
cnsvr.Open "serverdb", "svruser", "svruser"
Set newguid = uniqueidentifier
Set newguid = NEWID()
inputstr = InputBox("Enter Server Name"
svradd.Open "Master", cnsvr, adOpenKeyset, adLockOptimistic, adCmdTable
svradd.Fields("Servername"
svradd.Fields("svrguid"
svradd.Update
svradd.Close
End Sub