Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Other Forums
 MS Access
 Simple Add user function Good Stuff !

Author  Topic 

myhab
Starting Member

13 Posts

Posted - 2003-08-19 : 06:31:40
Hello there when I run this code it shows an Error :
--------------------------------------------------------------------------------------
Operation must use an updateable query.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.OleDb.OleDbException: Operation must use an updateable query.

Source Error:


Line 34: mycmd.CommandType = CommandType.Text
Line 35: mycmd.Connection.Open()
Line 36: mycmd.ExecuteNonQuery() 'This is the Error Line it highlights !
Line 37: mycmd.Connection.Close()
Line 38: End Function


--------------------------------------------------------------------------------------
Function Adduser(ByVal Name As String, ByVal password As String, ByVal Email As String)

Dim myconnection As New OleDbConnection(ConfigurationSettings.AppSettings("ConnectionString"))
Dim QueryStr As String = "INSERT INTO [Customer] ([Email], [Name], [Password]) VALUES ('" & Email & "' , '" & Name & "', '" & password & "')"
Dim mycmd As New OleDb.OleDbCommand(QueryStr, myconnection)
mycmd.CommandType = CommandType.Text
mycmd.Connection.Open()
mycmd.ExecuteNonQuery()
mycmd.Connection.Close()
End Function

Doug G
Constraint Violating Yak Guru

331 Posts

Posted - 2003-08-19 : 21:45:21
Maybe something here will help

http://www.dougscode.com/forum4/topic.asp?TOPIC_ID=5


======
Doug G
======
Go to Top of Page
   

- Advertisement -