|
customer.asp
<html>
<body>
<form method="post" action="add.asp">
<table>
<tr>
<td>CustomerID:</td>
<td><input name="custid" size="20"></td>
</tr><tr>
<td>Company Name:</td>
<td><input name="compname" size="20"></td>
</tr><tr>
<td>Contact Name:</td>
<td><input name="contname" size="20"></td>
</tr><tr>
<td>Address:</td>
<td><input name="address" size="20"></td>
</tr><tr>
<td>City:</td>
<td><input name="city" size="20"></td>
</tr><tr>
<td>Postal Code:</td>
<td><input name="postcode" size="20"></td>
</tr><tr>
<td>Country:</td>
<td><input name="country" size="20"></td>
</tr>
</table>
<br /><br />
<input type="submit" value="Add New">
<input type="reset" value="Cancel">
</form>
</body>
</html>
add.asp
<html>
<body>
<%
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open "C:\webshare\northwind.mdb"
sql="INSERT INTO customers (customerID,companyname,"
sql=sql & "contactname,address,city,postalcode,country)"
sql=sql & " VALUES "
sql=sql & "('" & Request.Form("custid") & "',"
sql=sql & "'" & Request.Form("compname") & "',"
sql=sql & "'" & Request.Form("contname") & "',"
sql=sql & "'" & Request.Form("address") & "',"
sql=sql & "'" & Request.Form("city") & "',"
sql=sql & "'" & Request.Form("postcode") & "',"
sql=sql & "'" & Request.Form("country") & "')"
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>
why cannot add the data to my database which my database's name northwind?
it come out "no update permision"
and how to add data to database?with asp and ms accesss...
__________________
Thanks for ur guiding.....:):):)
|