Indsættelse af checkbox værdi i access
Jeg vil meget gerne indsætte nogle værdier i min db.Men det driller. Jeg har 7 checkbokse, ikke alle skal vælges og de skal sættes ind i et tekst-felt.
Jeg får en fejl ala "cannot be a zero-length string"
Kan det lade sig gøre?
Udpuk fra koden:
<input type="checkbox" name="A1" value="ON">1.<br>
<input type="checkbox" name="A2" value="ON">2.<br>
<input type="checkbox" name="A3" value="ON">3.<br>
<input type="checkbox" name="A4" value="ON">4.<br>
<input type="checkbox" name="A5" value="ON">5.<br>
<input type="checkbox" name="A6" value="ON">6.<br>
<input type="checkbox" name="A7" value="ON">7.<br>
strSQL = "Insert into tilmeld ("
strSQL = strSQL & "A1, "
strSQL = strSQL & "A2, "
strSQL = strSQL & "A3, "
strSQL = strSQL & "A4, "
strSQL = strSQL & "A5, "
strSQL = strSQL & "A6, "
strSQL = strSQL & "A7) "
strSQL = strSQL & "values('"
strSQL = strSQL & Request.Form("A1") & "', '"
strSQL = strSQL & Request.Form("A2") & "', '"
strSQL = strSQL & Request.Form("A3") & "', '"
strSQL = strSQL & Request.Form("A4") & "', '"
strSQL = strSQL & Request.Form("A5") & "', '"
strSQL = strSQL & Request.Form("A6") & "', '"
strSQL = strSQL & Request.Form("A7") & "')"
Conn.Execute(strSQL)
