Solved

asp

Posted on 1998-08-31
2
164 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
ID: 1837261
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
ID: 1837262
Anymore questions, you can send them to me at masseym@hotmail.com
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Centering Vertically 3 34
jquery - show / hide div depending on day and time 19 46
Not seen Link button 5 37
How can I implement a "Select All" with this configuration...? 6 38
Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

815 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

9 Experts available now in Live!

Get 1:1 Help Now