By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,784 Members | 3,274 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,784 IT Pros & Developers. It's quick & easy.

Getting Database query error...

P: n/a
RAB
I tested my code on my local computer and it worked fine. When I
uploaded it to my webserver at Godaddy.com, I get the following
error...

Exception Details: System.Data.OleDb.OleDbException: Operation must use
an updateable query.
The line of code with the error is:
objCmd.ExecuteNonQuery
The rest of my code is as follows:

dim Conn as new OleDbConnection("Provider=" & _
"Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=mypath.mdb")

dim objCmd as OleDbCommand = new OleDbCommand _
("NewUserInput", Conn)
dim objReader as OleDbDataReader
objCmd.CommandType = CommandType.StoredProcedure

dim objParam as OleDbParameter

objParam = objCmd.Parameters.Add("@FirstName", _
OleDbType.char)
objParam.Direction = ParameterDirection.Input
objParam.Value = tbFN.Text
objParam = objCmd.Parameters.Add("@LastName", _
OleDbType.char)
objParam.Direction = ParameterDirection.Input
objParam.Value = tbLN.Text

objParam = objCmd.Parameters.Add("@Email", _
OleDbType.char)
objParam.Direction = ParameterDirection.Input
objParam.Value = tbEmail.Text

objParam = objCmd.Parameters.Add("@Zip", _
OleDbType.char)
objParam.Direction = ParameterDirection.Input
objParam.Value = tbZip.Text
objCmd.Connection.open()
objCmd.ExecuteNonQuery
objCmd.Connection.close()
Any help would be appreciated

Thanks,
RABMissouri

Dec 4 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Hi,

the error indicates that there's not enough/correct permissions set for
accessing the mdb file. E.g the user the application runs under should have
at least read/write permissions to the folder where mdb file resides. As is
evident, it is a thing to discuss with your hoster.

Before contact8ng your host, make sure that you provide the full and correct
path to the mdb file within the connection string (e.g if you have mdb on
your web app folders, which is not desirable solution, since anyone could
download the file, you could get full physical path to the mdb file by
using Server.MapPath)

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke

"RAB" <ra*********@yahoo.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
I tested my code on my local computer and it worked fine. When I
uploaded it to my webserver at Godaddy.com, I get the following
error...

Exception Details: System.Data.OleDb.OleDbException: Operation must use
an updateable query.
The line of code with the error is:
objCmd.ExecuteNonQuery
The rest of my code is as follows:

dim Conn as new OleDbConnection("Provider=" & _
"Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=mypath.mdb")

dim objCmd as OleDbCommand = new OleDbCommand _
("NewUserInput", Conn)
dim objReader as OleDbDataReader
objCmd.CommandType = CommandType.StoredProcedure

dim objParam as OleDbParameter

objParam = objCmd.Parameters.Add("@FirstName", _
OleDbType.char)
objParam.Direction = ParameterDirection.Input
objParam.Value = tbFN.Text
objParam = objCmd.Parameters.Add("@LastName", _
OleDbType.char)
objParam.Direction = ParameterDirection.Input
objParam.Value = tbLN.Text

objParam = objCmd.Parameters.Add("@Email", _
OleDbType.char)
objParam.Direction = ParameterDirection.Input
objParam.Value = tbEmail.Text

objParam = objCmd.Parameters.Add("@Zip", _
OleDbType.char)
objParam.Direction = ParameterDirection.Input
objParam.Value = tbZip.Text
objCmd.Connection.open()
objCmd.ExecuteNonQuery
objCmd.Connection.close()
Any help would be appreciated

Thanks,
RABMissouri

Dec 4 '05 #2

P: n/a
RAB
I called my web host and they said the folder where I have my Access
database has "full priviledges". Is there something else that might be
the problem?

Thanks,
RABMissouri

Dec 4 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.