Insert Into Statement Errors!

Sabre3487

New member
Joined
Nov 19, 2005
Messages
4
Programming Experience
1-3
strSQL = "INSERT INTO Table1 (Scores, S_Index) VALUES ('" & Score.Text & "')"

How do I alter this to accept a variable as well.

index = 2.4
name = "string"
H_index = 7.4

I have tried a few different parameter styles and keep getting errors??strSQL = "INSERT INTO Table1 (S_Index) VALUES ('"& index & ")"
I still get the error ???
I took your advice and sent this
strSQL = "INSERT INTO Table1 (name) VALUES (' sName ')"
I still get the error ???

Any help?
 
VB.NET:
Dim Cmd as new oledbccommand 
Cmd.commandtext =  "INSERT INTO name VALUES (?)"
cmd.parameters.add("@1",oledbtype.varwchar,255,"sName").value = 'what you want to insert.'
 
Back
Top