i have been struggling with this error for a while , i changed to many times to make sure no error but no luck Error on line 29 strsql.Parameters("@columna") = strmake <% Dim objCN ' ADO Connection object Dim objRS ' ADO Recordset object Dim strsql ' SQL query string Dim RecordsArray ' To hold the Array returned by GetRows Dim i ' A counter variable Dim strmake Dim objDBParam3 ' Create a connection object Set objCN = Server.CreateObject("ADODB.Connection") ' Connect to the data source objCN.Open "coonection;" set strsql = Server.CreateObject("ADODB.Command") strsql.ActiveConnection = objCN strsql.CommandText = "SELECT model ,CAT_ID FROM new WHERE CAT_ID = ? " strsql.CommandType = 1 strmake = "1" If (Request.QueryString("catid") <> "") Then strmake = Request.QueryString("catid") End If set objDBParam3 = strsql.CreateParameter("@columna",5, 1, -1) strsql.Parameters.Append objDBParam3 strsql.Parameters("@columna") = strmake set objDBParam3 = Nothing set objRS = strsql.Execute If objRS.EOF Then Response.Write "Erreur" Response.End end if RecordsArray = objRS.GetRows() %> <input name="marque" type="hidden" value="<%=RecordsArray(2, i) %>" > <select name="model" onchange="getCarburation(<%= RecordsArray(1, i) %>,this.value)"> <option value="">Tous</option> <% For i = 0 To UBound(RecordsArray, 2)%> <option value="<%=RecordsArray(0, i)%>"><%=RecordsArray(0, i)%></option> <% Next Response.write "</select>" 'End if objRS.Close objCN.Close Set objCN = Nothing Set objRS = Nothing %> I appreciate your help
Have you tried: strsql.Parameters("@columna") = Int(strmake) or: strsql.Parameters("@columna") = Val(strmake)
I tried this one here: strsql.Parameters("@columna") = Int(strmake) but getting this error: Description: Type mismatch: '[string: "make"]' the other one strsql.Parameters("@columna") = Val(strmake) just keep sending errors Val(strmake) Thank you