problem with insert

mars

Member
Joined
Jun 19, 2006
Messages
13
Programming Experience
1-3
hi
im new in asp.net
trying to insert a record with the following code

VB.NET:
dim ncount,connstr1 connStr1 = "Provider=Microsoft.Jet.OLEDB.4.0;data Source=c:\shopingcart1.mdb" 
dim cnAccess1 as New OleDbConnection(connStr1) 
cnAccess1.Open() 
dim cmd as new OleDbCommand 
cmd.Connection = cnAccess1 
cmd.CommandText ="insert into tmporder values (2)" 
nCount = cmd.ExecuteNonQuery() 
label1.text = "Inserted"
getting error "Operation must use an updateable query. "
the table tmporder just have a single number field

if any 1 knows that plz tell me

regards
mars
 
Last edited by a moderator:

cjard

Well-known member
Joined
Apr 25, 2006
Messages
7,052
Programming Experience
10+
did you miss the field specifier off the insert query?

You wrote:

INSERT INTO table VALUES (values)


I would expect the form to be:

INSERT INTO table(fields) VALUES (values)
 
Top Bottom