alright guys and gals
i have a basic program that is displaying records from a database, easy the prev and next buttons work fine, when i go to add a user it throws out errors
it says in the additional information there is a syntax error in INSERT INTO statment
the code looks like this
CODE
if inc <>-1 then
dim cb as new oledb.oledbcommandbuilder(da)
dim dsnewrows as dataraw
dsnewrows=ds.tables ("users").NewRow()
dsnewrows.item(0)=txtuser.text
dsnewrows.item(1) = txtpass.text
dsnewrows.item(2) = txtadmin.text
ds.tables("users").Rows.Add(dsnewrows)
da.update(ds, "users")
msgbox ("user added to the database")
end if
the database connection is fin the database has 3 fields
user name
pass
admin level
this code is executed on the commit changes to database button so when they have filled in the details it then does this
i also have the same problem with the edit facility as well that says the same error message
un unhandled exception of type system.data.oledb.oledbexception occured in system.data.dll
error in update statment
the code in the update looks like this
CODE
dim cb as new ole.oledbcommandbuilder(da)
ds.tables("users").rows(inc).item(0) =txtuser.text
ds.tables("users").rows(inc).item(1) =txtpass.text
ds.tables("users").rows(inc).item(2) =txtadmin.text
da.update(ds, "users")
msgbox("record updated")
on load of the form the da is set as follows
CODE
da=new oledb.oledbdataadapter(sql, con)
da.fill(ds, "users")
maxrows=ds.tables("users").rows.count
inc=-1
if there is anybody out there who could help me i would be very greatfull, i understand how to put records in with mysql statments but i dont see how you would build a insert statment. could i just do something like that.
thanks
dan