473,386 Members | 1,758 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,386 software developers and data experts.

How to create a .hta file (Access to local webpage)

Does anyone have a sample of an .hta file.

I need to put Access data in a local webpage. The data needs to be displayed
in an html table.(like a continous form)

So far I have the following but don't know how to get the data on an html
table

<html>
<head>
</head>
<Script Language="VBScript">
Dim conn
sub dotheconnection
Set conn = CreateObject("ADODB.Connection")
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data
Source=C:\aqGuestSeating8\GuestSeatingSytem3.mdb"
If conn.errors.count <0 Then
alert("problem connecting to the database")
else
' if connected OK call sub getdata
getdata
end if
end sub
sub getdata
SQL_query = "SELECT * FROM tGuestsWaiting"
Set rsData = conn.Execute(SQL_query)
Do Until rsData.EOF = True
' need to display table of data here xxxxxxxxxxxxx
rsData.moveNext ' go to next record
Loop
end sub
</script>
<body>
Finished
</body>
</html>
Aug 18 '08 #1
4 9661
In the
<head>

put something like this:
<hta:application
id="executeSQL"
applicationname="Execute SQL"
border="dialog"
caption="yes"
icon="http://www.ffdba.com/images/sql.ico"
showintaskbar="yes"
singleinstance="yes"
sysmenu="yes"
>
</head>

see
http://msdn.microsoft.com/en-us/library/ms536496.aspx
for more info

name your file:
whatever.hta

HTA's are powerful. I use them from time to time. But, if all users have
Access available I use the MS Web Browser Control as I find it to be much
slicker.

"Karl" <so*****@sbcglobal.bizwrote in
news:KT*******************@nlpi066.nbdc.sbc.com:
Does anyone have a sample of an .hta file.

I need to put Access data in a local webpage. The data needs to be
displayed in an html table.(like a continous form)

So far I have the following but don't know how to get the data on an
html table

<html>
<head>
</head>
<Script Language="VBScript">
Dim conn
sub dotheconnection
Set conn = CreateObject("ADODB.Connection")
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data
Source=C:\aqGuestSeating8\GuestSeatingSytem3.mdb"
If conn.errors.count <0 Then
alert("problem connecting to the database")
else
' if connected OK call sub getdata
getdata
end if
end sub
sub getdata
SQL_query = "SELECT * FROM tGuestsWaiting"
Set rsData = conn.Execute(SQL_query)
Do Until rsData.EOF = True
' need to display table of data here xxxxxxxxxxxxx
rsData.moveNext ' go to next record
Loop
end sub
</script>
<body>
Finished
</body>
</html>
Aug 18 '08 #2
rkc
On Aug 18, 5:41 pm, "Karl" <some...@sbcglobal.bizwrote:
Does anyone have a sample of an .hta file.

I need to put Access data in a local webpage. The data needs to be displayed
in an html table.(like a continous form)

So far I have the following but don't know how to get the data on an html
table

<html>
<head>
</head>
<Script Language="VBScript">
Dim conn
sub dotheconnection
Set conn = CreateObject("ADODB.Connection")
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data
Source=C:\aqGuestSeating8\GuestSeatingSytem3.mdb"
If conn.errors.count <0 Then
alert("problem connecting to the database")
else
' if connected OK call sub getdata
getdata
end if
end sub
sub getdata
SQL_query = "SELECT * FROM tGuestsWaiting"
Set rsData = conn.Execute(SQL_query)
Do Until rsData.EOF = True
' need to display table of data here xxxxxxxxxxxxx
rsData.moveNext ' go to next record
Loop
end sub
</script>
<body>
Finished
</body>
</html>
If I understand the question, you have to build and html string in
your loop
and then set the innerHTML property of some element in your html to
the
string you end up with.

Somewhere in your html: <div id="myContent"></div>

code snippet:

Dim sContent
Do Until rsData.EOF = True
'build html string
sContent = sContent & rs(0) & "<br>"
rsData.moveNext ' go to next record

myContent.innerHTML = sContent

Aug 19 '08 #3
You read the question before you answered!
Is that fair?

On Aug 19, 10:33*am, rkc <r...@rkcny.comwrote:
On Aug 18, 5:41 pm, "Karl" <some...@sbcglobal.bizwrote:
Does anyone have a sample of an .hta file.
I need to put Access data in a local webpage. The data needs to be displayed
in an html table.(like a continous form)
So far I have the following but don't know how to get the data on an html
table
<html>
<head>
</head>
<Script Language="VBScript">
Dim conn
sub dotheconnection
Set conn = CreateObject("ADODB.Connection")
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data
Source=C:\aqGuestSeating8\GuestSeatingSytem3.mdb"
If conn.errors.count <0 Then
alert("problem connecting to the database")
else
' if connected OK call sub getdata
getdata
end if
end sub
sub getdata
SQL_query = "SELECT * FROM tGuestsWaiting"
Set rsData = conn.Execute(SQL_query)
Do Until rsData.EOF = True
' need to display table of data here xxxxxxxxxxxxx
rsData.moveNext ' go to next record
Loop
end sub
</script>
<body>
Finished
</body>
</html>

If I understand the question, you have to build and html string in
your loop
and then set the innerHTML property of some element in your html to
the
string you end up with.

Somewhere in your html: *<div id="myContent"></div>

code snippet:

Dim sContent
Do Until rsData.EOF = True
* *'build html string
* *sContent = sContent & rs(0) & "<br>"
rsData.moveNext ' go to next record

myContent.innerHTML = sContent
Aug 19 '08 #4
rkc
On Aug 19, 1:17 pm, lyle fairfield <lyle.fairfi...@gmail.comwrote:
You read the question before you answered!
Is that fair?

On Aug 19, 10:33 am, rkc <r...@rkcny.comwrote:
On Aug 18, 5:41 pm, "Karl" <some...@sbcglobal.bizwrote:
Does anyone have a sample of an .hta file.
I need to put Access data in a local webpage. The data needs to be displayed
in an html table.(like a continous form)
So far I have the following but don't know how to get the data on an html
table
<html>
<head>
</head>
<Script Language="VBScript">
Dim conn
sub dotheconnection
Set conn = CreateObject("ADODB.Connection")
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data
Source=C:\aqGuestSeating8\GuestSeatingSytem3.mdb"
If conn.errors.count <0 Then
alert("problem connecting to the database")
else
' if connected OK call sub getdata
getdata
end if
end sub
sub getdata
SQL_query = "SELECT * FROM tGuestsWaiting"
Set rsData = conn.Execute(SQL_query)
Do Until rsData.EOF = True
' need to display table of data here xxxxxxxxxxxxx
rsData.moveNext ' go to next record
Loop
end sub
</script>
<body>
Finished
</body>
</html>
If I understand the question, you have to build and html string in
your loop
and then set the innerHTML property of some element in your html to
the
string you end up with.
Somewhere in your html: <div id="myContent"></div>
code snippet:
Dim sContent
Do Until rsData.EOF = True
'build html string
sContent = sContent & rs(0) & "<br>"
rsData.moveNext ' go to next record
myContent.innerHTML = sContent
I guess I should have mentioned document.write("Awesome page
content.") also, but the
innerHTML thing is way cooler.
Aug 19 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Petter Holmström | last post by:
Hello, I have a problem with file access which I believe is caused by a thread-problem. I first noticed it while trying to get PSP/Mod_Python to work in the shape of an exception claiming that...
13
by: John Howard | last post by:
I have the following in a jythonc program to be executed in a html file. f1 = open("filename","r") I get message about filePermission read error. Program compiles and jar file is created....
4
by: Rene' Nielsen | last post by:
Context: Running Windows 2003 Server on an intranet. A web is configured with an anonymous access account that is a domain account that has been granted the desired access to a file on another...
4
by: Bnob | last post by:
It is possible to create a file in local user-machine? With this code in code-behind: fs = New System.IO.FileStream(lFileCSV, System.IO.FileMode.Create, System.IO.FileAccess.Write) The file...
1
by: Duffman | last post by:
Hi, I have what seems to be a common problem, but the solutions I've found don't seem to work. I would like to use a web service to create a file at a UNC location in a shared file. Currently...
1
by: MD | last post by:
Is it possible to load the local xml file and display in the div? Currently i tried the following source when i put it to web always gives me error saying "access is denied" <!DOCTYPE HTML...
0
by: ravibrl | last post by:
Hey I need c++ code to access a webpage and download some software. If I execute that it should download that software and it should install it in my system. Give suggestions how to write that code...
2
by: Naha | last post by:
Hi Guys, Does anyone know how to display data from a text file onto a webpage? So far I have opened and read the data in the text file and printed it out on command line, but I am having...
2
by: Elavarasi | last post by:
( all in my websites) I am opening a database (stored in ftp -- ms access database) .. after retrieving i want to write to a file in local machine... (something .. c:\test.txt) its work fine...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.