Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

browser connect to Access without IIS 2

Status
Not open for further replies.

alfordjj

MIS
Jul 23, 2003
80
0
0
US
I have a need to move data to and from a local Access database via a web browser. Does anyone know of a way to do this without installing IIS/Apatche/etc on the local machine? This is a local DB with local HTML files; I'm not trying to serve it out to anyone.

Thanks!
 
Could you give a simple example of exactly what you are trying to do?
Have you tried docmd.transfertest with acFormatHTML ?
 
Thanks for your reply, jedraw.

I have only tried what I know: PHP & VBScript. Both of these require a web server on the box to connect to the DB. I read up on JS, but it looks like it requires one as well. I will look at the TransferText Method and see if it will work for me.

Further info:

I have inherited an MDB that has a clunky interface and I want to give it a smoother, HTML based, one. This database will be distributed to many locations and there is no central web server upon which to place it. Only the initial data is important to distribute, not any additional data that users my add; so I'm not worried about maintaining the data. It's simply giving sites info for them to start with. Having every site install IIS (or some other web service) would cause more problems than it would fix.

Here is an example:

An MS Access database located at c:\MyProgram\MyDatabase.mdb. Several HTML pages located in the same dir. Shortcut to index.html on the desktop.

When index.html is launched it pulls info from a table in MyDatabase.mdb and displays it. The user then can make changes to the data, click the submit button and MyDatabase.mdb would be update with the changes.

All the files local on the machine.


I hope this clarifies.

Thanks again.
 
I'd use HTA with VBScript using DAO.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
I am always impressed with PHV's posts. I suggest you follow his suggestion. If you have any issues, post back.
 
PH and jedraw,

Thanks for the info. I have gotten bogged down with other things at work at the moment, but I will try your suggestions as soon as possible.
 
PH,

Thanks for the great info. I finally got the HTA to gather data from Access. I ended up having to use an ADO connection to the ODBC because I couldn't find any code examples of VBS using DAO that would actually work. I believe I saw somewhere that I can set up the ODBC entry with VBS code, so I should be OK there.

Here is my code, in case anyone else is trying to do the same thing. This is the HTML and VBS code (just the basics).
Code:
<html><head>
<TITLE>Get Student Data</TITLE>
<HTA:Application
ID="GSD"
APPLICATIONNAME="Get Student Data"
Border="none"
Caption="no"
SingleInstance="yes"
WindowState="maximize">
</head>

<script language="VBScript">
option Explicit
On Error Resume Next

sub Window_onLoad

Dim fso, conn, SQuery, Rst, dataOutput 

'Creates the DB connection peramiters
set fso = CreateObject("Scripting.FileSystemObject")
set conn = CreateObject("ADODB.connection")
conn.ConnectionTimeout=30
conn.CommandTimeout=30

'connects to the ODBC database
conn.open ="RU"

'Sets the query
SQuery = "SELECT * From Students;"
'executes the query
Set Rst = conn.Execute(SQuery)

'makes sure we start reading at the begining of the table'
Rst.MoveFirst

dataOutput = "<table> "
'loops through the table and writes the data to a var
While Not Rst.EOF
  dataOutput = dataOutput & "<tr> "
  dataOutput = dataOutput & "<td> " & Rst("ContactID") & " </td> "
  dataOutput = dataOutput & "<td> " & Rst("FirstName") & " </td> "
  dataOutput = dataOutput & "<td> " & Rst("LastName") & " </td> "
  dataOutput = dataOutput & "<td> " & Rst("Address") & " </td> "
  dataOutput = dataOutput & "</tr>"
    Rst.MoveNext
Wend
dataOutput = dataOutput & " </table> "
'close the DB 
Rst.Close

'Writes the table to the webpage
DataArea.InnerHtml = dataOutput

'close all connections
Set fso = Nothing
conn.Close
Set conn = Nothing

End Sub
</script>

<body>
<span id="DataArea"></span>
 <p></p>
</html>

Thanks again to both PHV and jedraw!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top