Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

new to asp, not sure why I can't insert to database

Status
Not open for further replies.

tdrclan

Programmer
Sep 18, 2007
52
0
0
US
here is a test code that I'm tring to use to see if I can insert into my database. (I can select from the database.)

I'm new to asp and not sure what I'm complete doing.
I was able to create several retrieval screen now I need to work on insert and update.

currently using access 2000
( sql server will be the final db)
the table has two columns ( ID(autonumber) , and name)
ID is the PK.
-----------------
when I refresh the page in IE, I don't see any error nor do I see the response.write , not sure if it runs.

-----------------
<html>
<body>

<%

set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.open(server.mappath("\db\database.mdb"))

sql="INSERT INTO tblGameOwners ( Name ) Values ('twerwe');"

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

%>

</body>
</html>


---------------
I'm tring to get this plan code to work , due to the "required.object server" error msg from my other less plan asp page .


TIA

Tim
 
Fixed the problem:

the local permission on the database was not set to "write"

there where 4 entries
my domain login
user group
admin group
system group
the user group did not have write permission.

I used the following to figure this out.

'uncheck the friendly error on IE"

which changed "error on page" to 'must be an updateable query"

which the google search pointed to
seeing that iis_wpg did not exist I checked the other permission on the DB.

Tim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top