I’ve been drafted, from the admin side, to create web front in which will insert a row of data into an SQL dB. I’ve come up against a wall creating the agent. I can connect via ODBC however; the SQL Insert Into command doesn’t seem to execute. I’ve verified the SQL syntax but no go. Option Public
Uselsx “*LSXODBC”
Sub Initialize
Set con = New ODBCConnection ' added 2/20/08
Dim result As New ODBCResultSet
Dim DSN As String
Dim UID As String
Dim PWD As String
DSN = "Inserttest"
UID = "sa"
PWD = "cv1"
If con.ConnectTo("Inserttest", "sa", "cv1") Then
Dim qry As New ODBCQuery
Print "We are connected"
Set qry.Connection=con
Set result.Query=qry
result.Execute
result.AddRow
qry.SQL ="Insert Into SAPInfoNetDev.SalesOrders ('OrderNum')"
qry.SQL= qry.SQL & "values( '1023696 ')"
result.UpdateRow
Else
Print "No connection made"
End If
Set qry.Connection=con
Set result.Query=qry
'----- what are we getting
Print qry.SQL
Con.Disconnect
End Sub
TIA