ASP Hosting sale!
Double disk space and transfer for FREE!
Limited time offer! Act Now!

aspdev | articles | tutorials | forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

MS Access Database Error

 
Post new topic   Reply to topic    ASPdev.org Forum Index -> SQL Programming (MS SQL Server, MS Access, MySQL)
View previous topic :: View next topic  
Author Message
Imperial.Paul



Joined: 08 Jul 2005
Posts: 3

PostPosted: Fri Jul 08, 2005 1:59 pm    Post subject: MS Access Database Error Reply with quote

ey, I'm very new to using MS Access online, and I'm havnig some problems inserting data into the database. My code is:

Code:

Function addRecord()

set conn = Server.CreateObject("ADODB.Connection")
Dim connString
connString = "Driver={Microsoft Access Driver (*.mdb)};" & "Dbq=" & server.mappath("/database/imperialpools.mdb") & ";"
conn.Open connString

dim sql, newName, newEmail

newName = Request.form("name")
newEmail = Request.form("email")

sql="INSERT INTO dealers (dealer_id,dealer_name,dealer_email)"
sql=sql & " VALUES ('','" & Request.Form("name") & "'," & Request.Form("email") & "')"

on error resume next
conn.Execute sql,recaffected
if err<>0 then
Response.Write("No update permissions!")
else
Response.Write("<h3>" & recaffected & " record added</h3>")
end if
conn.close

End Function

No matter what I try, I always seem to get the error message. Anyone have any idea what I'm doing wrong?

Is this a permissions thing, and if so would it be on the server or a setting in the Access database itself?

I am using Access 2003, and the server I am forced to work on is running IIs/5.0

Thank you in advance.[/code]
Back to top
View user's profile Send private message
administrator
Site Admin


Joined: 01 Oct 2004
Posts: 183

PostPosted: Sat Jul 09, 2005 3:13 pm    Post subject: Reply with quote

Welcome to our forums Smile

This is not a permission thing most likely. To find the actual error, change the following code:

Code:

if err<>0 then
Response.Write("No update permissions!")
else
Response.Write("<h3>" & recaffected & " record added</h3>")
end if


to

Code:

if err<>0 then
Response.Write err.Description
else
Response.Write("<h3>" & recaffected & " record added</h3>")
end if


After you have done this, post the error here and I'll help you to resolve the issue.
_________________
Peter
ASP & ASP.NET Articles and Tutorials
Back to top
View user's profile Send private message
Imperial.Paul



Joined: 08 Jul 2005
Posts: 3

PostPosted: Mon Jul 11, 2005 10:20 am    Post subject: Reply with quote

I changed the code you asked and now I am getting the error:

"[Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable query"

A quick google search told me that this is a permission issue on the folder the database is stored.

The company I work for is hosted with the WORST hosting company anywhere, so getting them to change this for me is going to be very unpleasent...
Back to top
View user's profile Send private message
administrator
Site Admin


Joined: 01 Oct 2004
Posts: 183

PostPosted: Mon Jul 11, 2005 1:13 pm    Post subject: Reply with quote

You are correct, this is most likely a permission issue. Check the article below for details:

http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q175168

Which is the hosting company you are so unhappy with? I'm curious as I run a hosting company too Smile.
_________________
Peter
ASP & ASP.NET Articles and Tutorials
Back to top
View user's profile Send private message
Imperial.Paul



Joined: 08 Jul 2005
Posts: 3

PostPosted: Mon Jul 11, 2005 2:30 pm    Post subject: Reply with quote

Thank you for all the help and link...

The hosting company is http://www.mediausa.com.

I would like to drop them like... well, something you want to drop really fast but the company I work for will not budge on a move...

Grrr...
Back to top
View user's profile Send private message
administrator
Site Admin


Joined: 01 Oct 2004
Posts: 183

PostPosted: Tue Jul 12, 2005 3:34 pm    Post subject: Reply with quote

Thanks Paul,

Let me know if I can help with anything else?
_________________
Peter
ASP & ASP.NET Articles and Tutorials
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    ASPdev.org Forum Index -> SQL Programming (MS SQL Server, MS Access, MySQL) All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2002 phpBB Group

SQL Tutorial