首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
设在工程中有一个标准模块,并定义了如下类型: Type Stutype ino As Integer stmame As String*20 strsex As String*2 smark As Single
设在工程中有一个标准模块,并定义了如下类型: Type Stutype ino As Integer stmame As String*20 strsex As String*2 smark As Single
admin
2020-07-22
80
问题
设在工程中有一个标准模块,并定义了如下类型:
Type Stutype
ino As Integer
stmame As String*20
strsex As String*2
smark As Single
End Type
在窗体上画一个名为Command1的命令按钮,要求当执行事件过程Command1 Click时,在C盘根目录下的随机文件Student.dat中写入一条记录。下列能够完成该操作的是( )。
选项
A、Sub Command1_Click()
Dim student As Studtype
Dim record_no As Integer
record_no=1
With student
.ino=12:.strname="smith":
.strsex="男":.smark=89
EndWith
Open"c:\Student.dat"For Input As #1 Len= Len(Student)
Put#1,record_no,Student
Close #1
End Sub
B、Sub Command1_Click()
Dim Student As Stutype
Dim Record_no As Integer
Record_no=1
With Student
.ino=12:.strname="smith"
.strsex="男":.smark=89
EndWith
Open"c:\student.dat”For Random As#1 Len=Len(Student)
Put#1,Record_no.Student
Close #1
End Sub
C、Private Sub Command1 Click()
Dim Student AS Stutype
Dim Record_no As Integer
Record_no=1
With Student
.ino=12:.strname="smith"
.strsex="男":.smark=89
End With
Open"c:\student.dat"For Random As 1 Len=Len(Student)
Write#1.Record no.Student
Close#1
End Sub
D、Sub Command1 Click()
Dim Student As Stutype
Dim Record no As Integer
Record no=1
With Student
.ino=12:.strname="smith"
.strsex="男":.smark=89
EndWith
Open"c:\student.dat"For Output As#1 Len=Len(Student)
Put#1,Record no,Student
Close #1
End Sub
答案
B
解析
木题考杏文件操作。题目中要求以随机的方式(Random)打开一个文件,打开文件的方法格式为:Open FileName For Random As #文件号[Len=记录长度],然后以Put方法写入一条记录,方法的格式为:Put[#]文件号,[记录号],变量名。
转载请注明原文地址:https://kaotiyun.com/show/BrHp777K
本试题收录于:
二级VB题库NCRE全国计算机二级分类
0
二级VB
NCRE全国计算机二级
相关试题推荐
设有如下的程序段:n=0Fori=1To3 Forj=1Toi Fork=jTo3n=n+1 Nextk NextjNexti执行上面的程序段后,n的值为( )。
能够将组合框Combo1中最后一个数据项删除的语句为( )。
要想使列表框只允许单选列表项,应设置的属性为()。
下列叙述中正确的是( )。
如果要在窗体上画一个标签,应在工具箱窗口中选择的图标是( )。
执行下列语句:strInput=InputBox("请输入字符串","字符串对话框","字符串")将显示输入对话框。此时如果直接单击"确定"按钮,则变量strInput的内容是( )。
在数据库系统中,给出数据模型在计算机上物理结构表示的是
为了对多个控件执行操作,必须选中这些控件。下列不能选中多个控件的操作是
窗体上有一个名称为VScroll1的垂直滚动条,要求程序运行时,滚动块的初始位置在最下端,应该使VScroll1.Value的值等于
在考生文件夹下有一个数据库文件“samp3.accdb”,其中存在已经设计好的表对象“tEmployee”和查询对象“qEmployee”,同时还设计出以“qEmployee”为数据源的报表对象“rEmployee”。请在此基础上按照以下要求补充报表设计。
随机试题
Beautyisacuriousphenomenon,oneofpermeable,shiftingboundaries.Wemaythinkweunderstandit,【C1】______wesenseiteffor
肝细胞分泌胆汁的主要刺激物是
[2011年,第85题]在信号源(uS,RS)和电阻RL之间接入一个理想变压器,如图7.2-33所示,若uS=80sinωtV,RL=10Ω,且此时信号源输出功率最大,那么,变压器的输出电压u2等于()。
以下()不是城市变电所规划选址的要求。
监事会成员不少于3人,由公司职工代表组成,具体比例由公司章程规定。监事的任期每届为3年,监事任期届满,连选可以连任。( )
新增流动资金贷款额度的公式为()。
按题材分类,下列不属于中国画的是()。
Theworkersareracing______timetorepairtheroad.
Althoughdiverse,Africanmusichascertaindistinctivetraits,oneofwhichistheuseofrepetitionasanorganizingprinciple
AlmosteverydaythemediadiscoversanAfricanAmericancommunityfightingsomeformofenvironmentalthreatfromlandfills,g
最新回复
(
0
)