[Javascript] Database and SQL

Henrique Rennó henrique.renno at gmail.com
Tue Jan 30 09:35:41 CST 2007


Hello!!!

I don't have an example of my page but I'll try to describe the whole idea
behind it:

There are two fields where will be put an initial date and a final date
which will be part of the SQL filter statement.

There will be a dropdown box (select box) that when the user clicks on it,
he/she will select a country's state where all the values (state's names)
are stored in a field from a table in the Access database and will be loaded
into the select box being at most 30 values (I did it in a form inside
Access using VBA for the event onClick and using a ADODB component to access
the table and get the values executing an SQL statement constructed and
stored in a String variable).

Then the user will select an option from these ones that were loaded into
the select box (he/she will select a state's name) and there will be another
select box that will show values (cities' names) according to the one
selected inside the first select box where the first select box with states
works as a filter for the second one with cities (again, using VBA I did
with no problems, just created the SQL statement and executed it).

I think that solving these issues is almost all the work done as the other
things that the page will contain I know how to deal with simple Javascript.

Thanks a lot for the attention of all!!!!

On 1/30/07, Mike Dougherty <mdougherty at pbp.com> wrote:
>
> Do you have an example of your page so we can look at it?
>
> I ddin't assume ajax.  I thought the idea was to make an option list from
> a database.  That can be
> done on the web server before the page is downloaded.  You wouldn't even
> need javascript (unless
> you're using server-side javascript)
>
> If you want two selects such that the choice in the first select
> determines the contents of the
> second select, then try an old-school dhtml solution. (you have less than
> a hundred options per
> select, correct?)
>
>
>
> On Tue, 30 Jan 2007 11:00:27 -0200
>   "Henrique Rennó" <henrique.renno at gmail.com> wrote:
> > Hello!!!
> >
> > I have an Access Database and a form I had created to do some queries on
> the
> > data. One of the things I do is when the user clicks to open a dropdown
> box
> > it executes some code in VBA to compose a SQL statement and search for
> all
> > values stored in the field that this dropdown box will contain. Now I
> need
> > to put this database on the web and I'm using the perl module DBD::ODBC
> that
> > works very fine in order to access the Access database tables.
> >
> > I had put a html "form" tag with a "select" tag that I want to work the
> same
> > way the dropdown box works in the Access form. What I'm in doubt is if
> there
> > is a way of executing a script (with the form's action method) every
> time a
> > "select" (dropdown) box is open to load into it all the values from the
> > field in the database. Usually when a script is executed it loads the
> > results into another page (or a new window) but in this case the values
> > should go into a component without loading some other page.
> >
> > I don't know if doing it using Javascript is possible but I'd like some
> > hints of other kinds of technology I should learn like JSP or Servlets,
> > whatever could make this SQL query works the way I described.
> >
> > Thanks!!!
> >
> > --
> > Henrique
>
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript
>



-- 
Henrique
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20070130/df62df97/attachment.htm>


More information about the Javascript mailing list