Solved

asp

Posted on 1998-08-31
2
146 Views
Last Modified: 2010-04-09
I have an MS-ACCESS database that I want an access from the internet.  I have NT SERVER 4.0.  I think that is possible to do this by creating an .ASP file with ACCESS.

Can you help me?
0
Comment
Question by:DanielBlais
  • 2
2 Comments
 
LVL 10

Accepted Solution

by:
MasseyM earned 200 total points
Comment Utility
Sure thing,
Put this in the ASP file you have:

<%
Param = Request.QueryString("Param")
Data = Request.QueryString("Data")
CurrentYear = 0
CurrentDate = Date()
%>
<%
If IsObject(Session("YOURDSN_conn")) Then
    Set conn = Session("YOURDSN_conn")
Else
    Set conn = Server.CreateObject("ADODB.Connection")
    conn.open "YOURDSN","",""
    Set Session("YOURDSN_conn") = conn
End If
%>
<%
    sql = "SELECT * FROM YourTable "
    If cstr(Param) <> "" And cstr(Data) <> "" Then
        sql = sql & " WHERE [" & cstr(Param) & "] = " & cstr(Data)
    End If
    sql = sql & "ORDER BY YourTable.Field;"    
    Set rs = Server.CreateObject("ADODB.Recordset")
    rs.Open sql, conn, 3, 3
%>

<%
On Error Resume Next
rs.MoveFirst
do while Not rs.eof
%>
<% =rs.Fields("FieldName") ' This will print out the field...%>
<%
rs.MoveNext
Loop
%>

Also, make sure you set up a "SYSTEM DSN" in your ODBC control panel item to equal the DB name.


0
 
LVL 10

Expert Comment

by:MasseyM
Comment Utility
Anymore questions, you can send them to me at masseym@hotmail.com
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now