/    Sign up×
Community /Pin to ProfileBookmark

List of dynamic checkboxes

Hi, All,

I’m trying to create a list of checkboxes based on data from a Microsoft Database. Here is what I have so far:

[CODE]
<body>
<form name = “folderSelect”>
<table>
<% adoConn = new ActiveXObject(“ADODB.Connection”);
adoConn.Open(“Provider = Microsoft.Jet.OleDB.4.0; Data Source = C:/Fake2.mdb”);
adoRS = new ActiveXObject(“ADODB.Recordset”);
adoRS.Open(“SELECT ID, Name FROM Folder WHERE Parent = 1”, adoConn);

while (!adoRS.eof) {
%> <tr>
<td><input type = “checkbox” name = “check<%= adoRS(0) %>” onClick = “show(this)”><%= adoRS(1) %></td>
</tr>
adoRS.movenext;
<% }
adoRS.close;
adoConn.close;
%> </table>
</form>
</body>
[/CODE]

Unfortunately when I try to view the page, I get an error saying “adoConn” is unrecognized. What am I missing? I’m new to Javascript, so it’s probably something obvious. (At least I hope so!)

Thanks!

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@phpnoviceJul 11.2006 — That's not HTML/JavaScript. That is ASP/Jscript (the [COLOR=Blue]<% %>[/COLOR] tags give it away).

Also, [COLOR=Red]this[/COLOR]:

adoConn = [COLOR=Red]new ActiveXObject[/COLOR]("ADODB.Connection");



is only used in IE client-side. So, for ASP, that statement should be:



adoConn = [COLOR=Blue]Server.CreateObject[/COLOR]("ADODB.Connection");



Otherwise, please post ASP questions in the ASP forum.

Thanks.
×

Success!

Help @sjklein spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.26,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...