将表加载到数组中 [英] Loading tables into arrays

查看:78
本文介绍了将表加载到数组中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好!我正在尝试创建一个测验程序,并且正在进行心理障碍。我已经创建了一个表单,并希望cmdBegin_click()函数调用另一个名为loadtrivia()的函数。 loadtrivia函数将从表中获取3个字段(问题#/问题/答案),随机化它们并使用输入框询问问题并接受答案。事情是......我不知道如何加载表格。我在想一个数组,但语法让我感到困惑。谁能让我走上成功之路?感谢您的帮助!

Hello everyone! I am trying to create a quiz program, and am having a mental block. I''ve made a form, and want the cmdBegin_click() function to call another function called loadtrivia(). The loadtrivia function is going to take 3 fields from a table (question#/question/answer), randomize them and use an input box to ask the question and accept the answer. The thing is...I''m not sure how to load the table. I''m thinking an array, but the syntax is confusing me. Could anyone start me on the path to success? I appreciate your help!

推荐答案

以下是GetRows()方法文章的链接,它将从Recordset中检索数据并将其置于二维中数组:
http:// bytes .com / topic / access / insigh ...- using-getrows
PS - 你也可以创建一个Recordset,然后在其中选择一个随机记录编号,导航到它,然后发布问题。
Here is a Link to an Article on the GetRows() Method which will retrieve Data from a Recordset and place it in a 2-Dimensional Array:
http://bytes.com/topic/access/insigh...-using-getrows
P.S. - You could also create a Recordset, then select a Random Record Number within it, navigate to it, and post the Question.


嗨rnashting -


有几件事。你想一次从表中提出多少个问题?你是说你想随机选择哪些问题被拉出来?


Visual Basic有一个数组数据结构,但你可能对使用记录集更感兴趣。


Pat
Hi rnashting -

A couple of things. How many questions do you want to pull from the table at one time? And are you saying that you want to randomly pick which questions get pulled?

Visual Basic has an array data structure, but you might be more interested in using a recordset.

Pat


嗯。我认为记录集是要走的路,但这比我的技能水平要高一点。这就是我所做的:


1 - 创建一个包含3个字段的表(ID,问题,答案)

2 - 创建了一个使用命令按钮开始测验的形式


到目前为止我的代码是:
Hm. I''m thinking that a recordset is the way to go, but this is getting a little bit above my skill level. Here''s what I''ve done:

1 - Created a table with 3 fields (ID, question, answer)
2 - Created a form with a command button to start the quiz

The code I have so far is:
展开 | 选择 | 换行 | 行号


这篇关于将表加载到数组中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆