Append Field from my variable
Forums
Hello, how are you?
I need help, I have a variable as a string and I can't insert the value of the variable into the new column. Is it possible to do this?
For example:
Dim instancia As String
Set db = Client.OpenDatabase("Parámetros de contraseña.IMD")
Set task = db.TableManagement
Set field = db.TableDef.NewField
field.Name = "INSTANCIA"
field.Description = ""
field.Type = WI_VIRT_CHAR
field.Equation = instancia 'my error is here, I don't know how to add the content of my variable as a value of the fields.
field.Length = 100
task.AppendField field
task.PerformTask
Set task = Nothing
Set db = Nothing
Set field = Nothing
trim the code to where I understand that I have my error.
I await your reply.
Thank you so much!
Sure you can do the following
Sure you can do the following:
field.Equation = chr(34) & instancia & chr(34)
The chr(34) adds quotes around whatever the value contains within the instancia variable.