|
<< Click to Display Table of Contents >> Navigation: Programming Mechworks PDM > DBWCommandShell > Library Reference > Database > DBWSetDbworksStringFieldData |
Sets a field of the DOCUMENT table in DBWORKS
Function DBWSetDbworksStringFieldData(FieldToSet, FieldValue, DocUID)
FieldToSet |
field of the DOCUMENT table to set |
|---|---|
FieldValue |
value to set |
DocUID |
document unique id |
TRUE |
If the value has been correctly set |
|---|---|
FALSE |
otherwise |
As limitation, this command does not allow multi-line texts.
As a workaround, you can adapt your code as follows:
TxtStr = "Line1" & vbCrLf & "Line2"
Set connection = CreateObject("ADODB.Connection")
connection.Open DBWorksConnectionDSN, DBWorksConnectionUID, DBWorksConnectionPWD
connection.Execute("UPDATE DOCUMENT SET NOTES='" & TxtStr & "' WHERE UNIQUE_ID=" & docUniqueId)
connection.Close
Set connection = Nothing
field_to_set = "DESCRIPTION"
field_value = "spinkler"
docUid = 357
resp = DBWSetDbworksStringFieldData(field_to_set, field_value, docUid)
if resp then
msgbox "field successfully updated"
else
msgbox "An errors has occurred!"
end if