access| Source Code <%
' Generic ASP Editor for Access Tables
' Version 1.01-9 November 1999
' ? Roman Koch
' =====================================================================
' Your customisations Go
' =====================================================================
' Enter ' The name of the system DSN
Session ("MyDSN") = "MP3"
' Enter ' The name of the table you want to edit
' Note:for text fields, the ' Allow Zero Length ' attribute must is set to YES
Session ("myTable") = "Customer"
' Enter ' The name of the Primary Key field
' Note:the Primary Key must be a ' Autonumber '-type field
Session ("MyKey") = "CustomerID"
' =====================================================================
' End of the customisation section
' =====================================================================
Dim objconn
If IsObject (Session ("dsndefined")) Then
Set objconn = Session ("dsndefined")
Else
Set objconn = Server.CreateObject ("ADODB. Connection ")
objConn.Open session ("MyDSN")
Set session ("dsndefined") = objconn
End If
Strmyownpath = Request.ServerVariables ("Path_info")
Intstart = InStrRev (Strmyownpath, "/", -1,1)
Strmyname = Mid (strmyownpath,intstart+1)
Session ("myname") = Strmyname
Straction = Request.QueryString ("action")
Lngrecord = request.querystring ("num")
Select Case Straction
Case "List", "List all records
Call Editlist ()
Case "Update", "get", "Current," and display in a form for editing
Call Editupdate (Lngrecord)
Case "Updateexec" ' Save the changes '
Call Editupdateexec (Lngrecord)
Case "Insert" ' Display an empty form for entering a new record
Call Editinsert ()
Case "Insertexec" ' Save the new record
Call Editinsertexec ()
The case "Delete" "Display the" "deletion" can be confirmed
Call Editdelete (Lngrecord)
Case "Deleteexec" ' Deletes the record
Call Editdeleteexec (Lngrecord)
Case Else ' same as list parameter
Call Editlist ()
End Select
%>
<script runat= "SERVER" language= "VBSCRIPT" >
'======================================================================
Function editupdate (Lngrecord)
'======================================================================
Strmytable = Session (' My