M
msch-prv
I am trying to pull out data from an Access mdb via the Like()
operator. The code works fine for specific values ie 3, 4 but fails for
the '*' value.
TIA for any hints. Mark
Code excerpt: (ddnEmp.SelectedValue is a dropdown box, with values: 0,
1, 2 etc.)
Dim mstrConn As String =
ConfigurationManager.ConnectionStrings("DbConn").ConnectionString
Dim mobjConnection As New OleDbConnection(mstrConn)
Dim strFrom As String = ddnEmp.SelectedValue
Dim strSQL As String = "SELECT qryActByDay.*, * FROM qryActByDay WHERE
qryActByDay.ActFrom Like(@From);"
Dim objCommand As New OleDbCommand(strSQL, mobjConnection)
Dim prm As New OleDbParameter()
With prm
.ParameterName = "@From"
'If 0 show all data
If strFrom <> "0" Then .Value = strFrom Else .Value = "'*'"
End With
objCommand.Parameters.Add(prm)
operator. The code works fine for specific values ie 3, 4 but fails for
the '*' value.
TIA for any hints. Mark
Code excerpt: (ddnEmp.SelectedValue is a dropdown box, with values: 0,
1, 2 etc.)
Dim mstrConn As String =
ConfigurationManager.ConnectionStrings("DbConn").ConnectionString
Dim mobjConnection As New OleDbConnection(mstrConn)
Dim strFrom As String = ddnEmp.SelectedValue
Dim strSQL As String = "SELECT qryActByDay.*, * FROM qryActByDay WHERE
qryActByDay.ActFrom Like(@From);"
Dim objCommand As New OleDbCommand(strSQL, mobjConnection)
Dim prm As New OleDbParameter()
With prm
.ParameterName = "@From"
'If 0 show all data
If strFrom <> "0" Then .Value = strFrom Else .Value = "'*'"
End With
objCommand.Parameters.Add(prm)