473,385 Members | 1,661 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Reading a Microsoft Access File

Hi,
I have a Access mdb file. I want to read it and gather the data from it. How can I do that? I dont have any IDE and I am using notepad to write the code. I want to use VB Script, if it possible with it, else suggest me.
Feb 27 '08 #1
2 922
Hello
You can use VBScript with ASP or only VBScript
Use following steps

'Declare Variables
Dim rs, conn, DatabaseLocation

'Get the location of your Access Database
DatabaseLocation = Server.MapPath("Employee.mdb")

'Create a ADO Connection Object
SET conn=Server.CreateObject("ADODB.Connection")

'Assign the Provider
conn.Provider="Microsoft.Jet.OLEDB.4.0"

'Open the connection
conn.Open DatabaseLocation

'Open the RecordSet using ADO Recordset Object
SET rs = Server.CreateObject("ADODB.Recordset")

'Query the table in the database
sql = "Select * from Resources"

'Open the result set
rs.Open sql, conn

c=0
do while not rs.eof
c=c+1
document.write rs("EmployeeName")
rs.movenext
loop

Set rs = nothing
conn.close

Hope this helps!

Hi,
I have a Access mdb file. I want to read it and gather the data from it. How can I do that? I dont have any IDE and I am using notepad to write the code. I want to use VB Script, if it possible with it, else suggest me.
Feb 27 '08 #2
Plater
7,872 Expert 4TB
This really seems like it falls more under the the regular VB rather then VB.NET since you wish to use VBScript.

I will move it there.

MODERATOR
Feb 27 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Kevin T. Ryan | last post by:
Hi All - I'm not sure, but I'm wondering if this is a bug, or maybe (more likely) I'm misunderstanding something...see below: >>> f = open('testfile', 'w') >>> f.write('kevin\n') >>>...
1
by: Michael Palmer | last post by:
I'm reading xml from SQL Server 2K with VB.net using an XSD schema file and SQLXML 3.0. I have the below code working fine, but I'd like to change the code from reading the schema file from a...
1
by: Magnus | last post by:
allrite folks, got some questions here... 1) LAY-OUT OF REPORTS How is it possible to fundamentaly change the lay-out/form of a report in access? I dont really know it that "difficult", but...
3
by: trellow | last post by:
Hello, I am writing an application that needs to read a file that is already open by another process for writing. When I do the following: FileStream fs = new FileStream(fileName,...
4
by: Andy | last post by:
Hello All: I have a field in the database that is an Image. I have no idea how the data is stored in here (Image, compressed, encrypted, plain text, etc). I am trying to write the contents to...
3
by: dale zhang | last post by:
Hi, I am trying to read an image from MS Access DB based on the following article: http://www.vbdotnetheaven.com/Code/Sept2003/2175.asp The article author is using PictureBox for windows...
7
by: zxkuqyb | last post by:
I've written a simple ASP .NET web application that reads a text file and displays it in the web browser. Works fine when reading a local path; but fails with "can not find a part of the path", or...
2
by: Paul M | last post by:
Hello, is there any way of reading Microsoft Access Macros via VBA code? Or better still through VB .net code? By reading I mean being able to read what the actions are plus any parameters &...
2
by: Wes Peters | last post by:
Does anyone know of an article that deals with the subject of reading a structured text file using VBA code in Access? Thanks, Wes
9
by: pob | last post by:
I currently have a procedure that loops thru a recordset to determine what files need to be loaded to my database. The naming convention of the files has always been accounts.txt, namelist.txt,...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.