Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to make Access table updatable from the WEB environment
Message
From
28/05/2003 15:40:31
 
 
To
All
General information
Forum:
ASP.NET
Category:
Other
Title:
How to make Access table updatable from the WEB environment
Miscellaneous
Thread ID:
00793692
Message ID:
00793692
Views:
60
I trying to update/insert a record into an Access table using VBScript utilizing sql INSERT/UPDATE command. But, each time it tells me that table is read only. Does anyone know what I need to set to make this table updatable? I've already set the folder where the VBScript and the Access table to read and write. I don't know where else I'll need to set. Any help is appreciated. Just encase I'm doing something wrong with my ASP script, attached is the code
<%
'*********************************************
SUB ADD_bac_msis

If Request.Form("id")="" Then

	strSQL = "INSERT INTO bac_msis (idnumber, sysname, type, bacfreq, population, status)"
	strSQL = strSQL & " VALUES "
	strSQL = strSQL & "('" & Request.Form("idnumber") & "',"
	strSQL = strSQL & "'" & Request.Form("sysname") & "',"
	strSQL = strSQL & Request.Form("type") & ","
	strSQL = strSQL & Request.Form("bacfreq") & ","
	strSQL = strSQL & Request.Form("population") &","
	strSQL = strSQL & "'" & Request.Form("status") & "')"
	Response.Write(strSQL & " <BR>")
Else
	strSQL = "UPDATE bac_msis SET "
	strSQL = strSQL & "id=" & Request.Form("id") & ", "
	strSQL = strSQL & "idnumber= '" & Request.Form("idnumber") &"', "
	strSQL = strSQL & "sysname='" & Request.Form("sysname") &"', "
	strSQL = strSQL & "type=" & Request.Form("type") &", "
	strSQL = strSQL & "bacfreq=" & Request.Form("bacfreq") &", "
	strSQL = strSQL & "population=" & Request.Form("population") &", "
	strSQL = strSQL & "status='" & Request.Form("status") &"'  "
	strSQL = strSQL & " WHERE id=" & Request.Form("id")
	Response.Write(strSQL & " <BR>")
End If

strDBPath = Server.MapPath("newbac.mdb")
Set cnnSearch = Server.CreateObject("ADODB.Connection")
cnnSearch.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDBPath & ";"

on error resume next
cnnSearch.Execute strSQL
if err<>0 then
	Response.Write("No update permissions! <BR>")
else 
 	Response.Write("update successful. <BR>")
end if
cnnSearch.close

END SUB
'********************************
'********************************
%>

<HTML>
<HEAD>
<P> BAC_MSIS TABLE UPDATE </P>
</HEAD>
<BODY> 
<%
  For Each Field In Request.Form
     Response.Write "<b>" & Field & ":</b> " & Request.Form(Field) & "<BR>" & vbCrLf
  Next
  ADD_bac_msis
%>
<BR>
<A HREF="mysrch.asp">[Back to Search Form]</A>
</BODY>
</HTML>
Next
Reply
Map
View

Click here to load this message in the networking platform