I am trying to use a field value the is entered by the user as a parameter in a SQL statment in LotusScript. I’ve looked at the help and dimmed the parameter as the help indicated, but I still can’t get it to work. If anyone can offer any ideas, I’d appreciate it. Here is my code:
Dim con As New ODBCConnection
Dim qry As New ODBCQuery
Dim result As New ODBCResultSet
Dim FN_Collection As String
Dim msg As String
Dim Workspace As New NotesUIWorkspace
Set uidoc = Workspace.currentdocument
Dim curDoc As NotesDocument
Set curDoc = uidoc.document
Dim Temp_Item As String
Dim Item As NotesItem
If Not con.ConnectTo(“winchem”, “”,“”) Then Messagebox “Could not connect”, “Error connecting”
Exit Sub
End If
Set qry.Connection = con
Set result.Query = qry
Dim inputParameter As String
inputParameter = uidoc.FieldGetText("wc_formula_code")
Call result.SetParameter(1, "'" & inputParameter & "'")
qry.SQL = "SELECT CREAT_DATE FROM DFORMULA Where Pcode = ?inputParameter? " result.Execute
If result.IsResultSetAvailable Then
Do
result.NextRow
FN_Collection = result.GetValue(“CREAT_DATE”) Temp_item= Temp_Item &“,”& FN_Collection
Loop Until result.IsEndOfData
result.Close(DB_CLOSE)
Else
Messagebox "No data retrieved",, "No data"
Exit Sub
End If
Messagebox FN_Collection,,"Data"
con.Disconnect 'disconnects ODBC connection