By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,651 Members | 1,694 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,651 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.