Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Inserting a record from ASP to Access DB

Status
Not open for further replies.

morg27

MIS
Feb 4, 2002
16
US
I am having trouble with allowing the user to enter info into fields pressing a submit button which inserts the fields into my access database. It gives me a compile error saying that "System.Data.OleDb.OleDbException: Operation must use an updateable query." Here is the code:

sub Page_Load()


Dim strConnection as String = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=''My data source
Dim objConnection as New OledbConnection(strConnection)
objConnection.Open()

Dim objCmd as New OledbCommand()

objcmd.connection = objconnection
objcmd.commandtext = "insertnewlogin"
objcmd.commandtype = commandtype.storedprocedure

objcmd.parameters.add("@UserID",
oledbtype.varchar).value=userid.text

objcmd.parameters.add("@Password", oledbtype.varchar).value=password.value

objcmd.parameters.add("@Name", oledbtype.varchar).value=name.text

objcmd.parameters.add("@Email", oledbtype.varchar).value=email.text

objcmd.parameters.add("@State", oledbtype.varchar).value=state.text

objcmd.parameters.add("@Question", oledbtype.varchar).value=question.text

objcmd.parameters.add("@Answer", oledbtype.varchar).value=answer.text

objcmd.executenonquery()

objConnection.Close()

end sub
</script>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top