Product: LABELVIEW Gold, CODESOFT Enterprise
Version: 2014 & Newer
|
Dim ConnString
Dim SQL
Dim myConn
Dim MyCommand
DIM VARVALUE
VARVALUE = Document.Variables.Item("VAR1").Value()
SQL = "INSERT INTO [DATABASE].[dbo].[TABLE](COLUMN) VALUES('" & VARVALUE & "')"
ConnString="DRIVER={SQL Server};SERVER=(local)\SQLEXPRESS;UID=sa;" & _
"PWD=PASSWORD;DATABASE=DATABASE"
Set myConn = CreateObject("ADODB.Connection")
Set myCommand = CreateObject("ADODB.Command" )
myConn.Open ConnString
Set myCommand.ActiveConnection = myConn
myCommand.CommandText = SQL
myCommand.Execute
myConn.Close
Notes:
SQL = "INSERT INTO [DATABASE].[dbo].[TABLE](COLUMN) will need to be changed to match the database name, tables, and columns being used.
Var1 is the name of the data source on the label design that is being referenced. This can also be changed to fit environment.
ConnString="DRIVER={SQLServer};SERVER=(local)\SQLEXPRESS;UID=sa;"&_"PWD=PASSWORD;DATABASE=DATABASE" will also need to be changed to reflect proper server credentials.
|