General ASP Editor for Access source code

Source: Internet
Author: User
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



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.