help in executing a query
Hi,
I was trying to list all details for names beginning with a particular character from the emp table in a data report. I am trying to pass this ename as a parameter from a textbox within a form. The query i wrote in the command was -
select * from emp where ename like '?%'
I have assigned the parameter fields as varchar in the parameters tab of the command object in the data environment.
The code for viweing the report is -
Private Sub Command1_Click()
If DataEnvironment1.rsCommand1.State = adStateOpen Then
DataEnvironment1.rsCommand1.Close
End If
DataEnvironment1.Command1 trim(Text1.Text)
Set DataReport1.DataSource = DataEnvironment1
DataReport1.Show
End Sub
Now when i enter S in the textbox and press the button, i get this error -
Run-time error 3708
Application defined or object defined error.
Any ideas how to fix this. The same query works in Oracle. Thanks.