DBWSetDbworksStringFieldData

<< Click to Display Table of Contents >>

Navigation:  Programming Mechworks PDM > DBWCommandShell > Library Reference > Database >

DBWSetDbworksStringFieldData

Description

Sets a field of the DOCUMENT table in DBWORKS

Syntax

Function DBWSetDbworksStringFieldData(FieldToSet, FieldValue, DocUID)

Parameters

FieldToSet

field of the DOCUMENT table to set

FieldValue

value to set

DocUID

document unique id

Return Values

TRUE

If the value has been correctly set

FALSE

otherwise

Remarks

warningAs 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

Example

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