469,887 Members | 1,206 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,887 developers. It's quick & easy.

Getting Database query error...

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
2 1055
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
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.

Similar topics

4 posts views Thread by behindspace | last post: by
11 posts views Thread by mikey_boy | last post: by
4 posts views Thread by Max Harvey | last post: by
2 posts views Thread by srusskinyon | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.