Using a macro, how to add a sqlSequence and change its start value?
The following code always set the start value to 1. I'd like it to be set to dlg.startwTxt
Dim seq As SQLServerSequence
Set seq = mdl.SQLServerSequences.Add(ent.TableName, ent.Owner)
If dlg.startwChbx = 1 Then seq.StartWith = Trim(dlg.startwTxt)End If
I'm guessing that:
returns a string. So you'll need to convert that to an integer first. So I think you'll need to do something like:
seq.StarWith = CInt(Trim(dlg.startwTxt))
you are correct. it is working with CInt.
The documentation for the SqlSequence.StartWith property is misleading:This property represents the value that the SQL Server Sequence will start with. DATATYPE: String.