Getting Database query error...

R

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
 
T

Teemu Keiski

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)
 
R

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top