View previous topic :: View next topic |
Author |
Message |
Imperial.Paul
Joined: 08 Jul 2005 Posts: 3
|
Posted: Fri Jul 08, 2005 1:59 pm Post subject: MS Access Database Error |
|
|
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 |
|
|
administrator Site Admin
Joined: 01 Oct 2004 Posts: 183
|
Posted: Sat Jul 09, 2005 3:13 pm Post subject: |
|
|
Welcome to our forums
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 |
|
|
Imperial.Paul
Joined: 08 Jul 2005 Posts: 3
|
Posted: Mon Jul 11, 2005 10:20 am Post subject: |
|
|
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 |
|
|
administrator Site Admin
Joined: 01 Oct 2004 Posts: 183
|
|
Back to top |
|
|
Imperial.Paul
Joined: 08 Jul 2005 Posts: 3
|
Posted: Mon Jul 11, 2005 2:30 pm Post subject: |
|
|
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 |
|
|
administrator Site Admin
Joined: 01 Oct 2004 Posts: 183
|
|
Back to top |
|
|
|
|
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
|