Computing.Net > Forums > Programming > WebPage and Access DB

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

WebPage and Access DB

Reply to Message Icon

Name: Opas
Date: March 5, 2003 at 05:28:16 Pacific
OS: Windows XP
CPU/Ram: 700MHz 384MB
Comment:

I want to make a webpage that will access an MS Access Database (.mdb) make a search and display some results in the webpage. I try with asp and php. Is there any easiest way of doing it?



Sponsored Link
Ads by Google

Response Number 1
Name: Dr. Nick
Date: March 5, 2003 at 11:32:13 Pacific
Reply:

ASP makes it very easy to pull information from an Access database. Here is an example of how to do it.

^^^^^^^^^^^^^^^^^^^^^^^^^

[HTML]
[HEAD]
[TITLE]Student Records[/TITLE]
[/HEAD]
[BODY]
[%
Dim DB
Set DB = Server.CreateObject ("ADODB.Connection")
DB.Open ("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" +
"C:\Databases\Students.mdb")
Dim RS
Set RS = Server.CreateObject ("ADODB.Recordset")
RS.Open "SELECT * FROM Students", DB
If RS.EOF And RS.BOF Then
Response.Write "There are 0 records."
Else
RS.MoveFirst
While Not RS.EOF
Response.Write RS.Fields ("FirstName")
Response.Write RS.Fields ("LastName")
Response.Write "[HR]"
RS.MoveNext
Wend
End If
%]
[/BODY]
[/HTML];

^^^^^^^^^^^^^^^^^^^^^^^^
*Note: You'll need to replace the ] and [ symbols with less than and greater than signs*


This gives you an example on how to read info from an Access database. There are lots of books and ebooks out there that will give you an in depth look. I have a couple, and if you want I can email them to you.

hth


0
Reply to Message Icon

Related Posts

See More


Fetching Unread mails usi... question in C++ on ignori...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: WebPage and Access DB

PHP/Access DB problem www.computing.net/answers/programming/phpaccess-db-problem/8313.html

Visual C# - Updating an access DB www.computing.net/answers/programming/visual-c-updating-an-access-db/17636.html

VB6 access DB in win98 www.computing.net/answers/programming/vb6-access-db-in-win98/11457.html