Hi,
I am using VisualStudio for WebExpress and VB.NET and my data is in an MS Access 2010 database (.accdb)
I connect using OLEDb (that part works well).
I have been trying (so far in vain) to understand how to construct an INSERT INTO query that can use parameters instead of literal values.
The MSDN info on this usage does not exist (at least I cannot find it)
Below is the code that fails for syntax error. It is part of an ASP.NET application I am developing.
sPN is defined as a string

strQuery = "INSERT INTO PartNumbers (PartNum) VALUES (" '" & sPN & "')"
Using con As OleDbConnection = New OleDbConnection(constring)
Using cmd As OleDbCommand = New OleDbCommand(strQuery, con)
cmd.CommandType = CommandType.Text
con.Open()
cmd.ExecuteNonQuery()
End Using
con.Close()
End Using
The result is a Syntax Error in the INSERT statement.

I have verified the connection part is ok with other actions (running a stored MS Access query for example)
I do not understand why Visual Studio puts a space between the first double quote and the next single quote. Obviously there is a reason but no luck trying to find any information on the net about that.
I tried VALUES (sPN)
I tried VALUES (sPN);
I tired VALUES (" '" & sPN & "'") having read text must be enclosed by single quotes
No luck
I would appreciate any help there understanding what the rules are and where they are documented.
Thanks in advance
Olivier