PDA

View Full Version : ASP.NET & MS Access


david7777
06-12-2003, 01:07 PM
I know how to create a DSNless connection to ms access database, and how to query etc, but when i try to insert data, i come to a problem...

I have the following code:

Dim dbconn As System.Data.OleDb.OleDbConnection = New System.Data.OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;data source=" & Server.MapPath("database.mdb"))
dbconn.Open()
Dim dbcomm As System.Data.OleDb.OleDbCommand = dbconn.CreateCommand()

Dim sql As String = "INSERT INTO tblUsers VALUES( 0, '" & UserName.Text & "', '" & UserPass.Text & "')"
dbcomm.CommandText = sql

Dim results as Integer = dbcomm.ExecuteNonQuery()


What am i doing wrong?

It gives the error of:
"Operation must use an updateable query. "

ReyN
06-12-2003, 08:01 PM
hello

is the folder where the db is located set to have write permission?

david7777
06-13-2003, 08:52 AM
Thanx for pointing out that stupid mistake... I actually realised the problem just before reading your reply... :o