首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
设在工程中有一个标准模块,并定义了如下类型: Type Stutype ino As Integer stmameAs String*20 strsexAs String*2 smark As Single
设在工程中有一个标准模块,并定义了如下类型: Type Stutype ino As Integer stmameAs String*20 strsexAs String*2 smark As Single
admin
2016-03-21
71
问题
设在工程中有一个标准模块,并定义了如下类型:
Type Stutype
ino As Integer
stmameAs String*20
strsexAs String*2
smark As Single
EndType
在窗体上画一个名为Commandl的命令按钮,要求当执行事件过程Commandl Click时,在C盘根目录下的随机文件Student.dat中写入一条记录。下列能够完成该操作的是( )。
选项
A、Sub Command 1_Click()
Dim student As Studtype
Dim record_no As Integer
record no=l
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 Command 1 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)
Put#1,Record no,Student
Close#1
End Sub
C、Private Sub Commandt Click()
Dim StudentAs Stutype
Dim Record no As Integer
Record no=1
With Student
.ino=12:.stmame:“smith”
.strsex=“男”:.smark=89
End With
Open“c:\student.dat”For Random As 1 Len=
Len(Student)
Write
D、Sub Commandl—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,Recor
答案
B
解析
本题考查文件操作。题目中要求以随机的方式(Random)打开一个文件,打开文件的方法格式为:0pen File NameForRandomAs#文件号[Len=记录长度],然后以Put方法写入一条记录,方法的格式为:Put[#]文件号,[记录号],变量名。
转载请注明原文地址:https://kaotiyun.com/show/egLp777K
本试题收录于:
二级VB题库NCRE全国计算机二级分类
0
二级VB
NCRE全国计算机二级
相关试题推荐
下列程序段的输出结果是()。A=0PrintA+1A=3
数据库系统中实现各种数据管理功能的核心软件称为【】。
下列程序段的执行结果为______。Dimm(3,3)AsIntegerDimiAsIntegerDimjAsIntegerDimxAsIntegerFori=1To3m
为了使图片框的大小可以自动适应图片的尺寸,则应______。
随机文件以【】为单位读写。
设y是整形变量,能判断y为奇数的表达式是
下列叙述中正确的是
双击窗体中的对象后,VisualBasic将显示的窗口是
检查软件产品是否符合需求定义的过程称为()。
在考生文件夹下有一个数据库文件“samp3.accdb”,里面已经设计好表对象“产品”、“供应商”,查询对象“按供应商查询”和宏对象“打开产品表”、“运行查询”、“关闭窗口”。请按以下要求完成设计。创建一个名为“menu”的窗体,要求如下:
随机试题
男,45岁,较肥胖,因面部反复疖肿2个月就诊,无明显“三多一少”症状,空腹血糖7.6mmol/L,父母均为2型糖尿病患者若该患者临床2型糖尿病已证实,其首选治疗方案是
“寒热”是
妊高征患者下列各项辅助检查中,哪一项能提示病情的轻重程度
王某趁同事张某出差不在单位,在领导和其他同事面前大肆传播张某跟某小姐的“风流韵事”,张某回来之后发现众人对自己态度异常,终于查明真相,原来某小姐完全是王某捏造的,遂一怒之下告到法院。对此案你认为下列说法不正确的有:
招标文件的作用有()。
出入境检验检疫法规已形成相对完整的法律体系,奠定了依法施检的执法基础。()
进入风景名胜区的门票,由()负责出售。
()是地陪安排并落实旅游团活动的主要契约性依据。
主张学习是学习者主动地建构内部心理表征的过程的学习理论是()
TheUScourtsystem,aspartofthefederalsystemofgovernment,ischaracterizedbydualhierarchies;therearebothstateand
最新回复
(
0
)