-
Db results in an array....possible?
Hi,
Desparately need your assistance. Is it possible to return results from an access db in an array?
I have a function that connects to Access97 and the select/query statement returns a list of values. I can 'response.write' them in html, but need them to be in a combo box.
I was thinking of having the array populate the combo box, but I'm missing a step. How do I get the results into the array? Could I use a variable? If so, would I need to parse for each option?
I know ASP/VBscript/etc... would be much easier, but these are not an option for me.
Thank you!
-
-
Hmmm... i'm not sure how well writing a code with that same language works. I mean... you can't have a program program itself.
So... shouldn't be that hard, though. (as long as you're not trying to add code to the script)
What you should do is use for or while loops (does JS even have these? I use php, so can't promise it'll work).
Use a while statement to set:
array[n] = result;
During that loop, make n get bigger each time and result be the next result... however that will work.
Hopefully pointing you the right way
Daniel -
Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum
-
-
Maybe, you can try to use a loop to show all of the result, like this:
String [] result = new String[]; //Of course,you can use other type, int etc.
int i = 0;
while(rs.next()){
result[i] = rs.getString(1);
i = i + 1;
}
Now, the resultset is in result[].
Hope they are helpful...
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks