用vb+excel做学生成绩管理系统
遇到这样一个问题
在按专业打印学生毕业成绩单时,按学期的课程要在一行内打印,如英语是四个学期要打印在一行中,怎么才能实现?
我是利用rs1是取出一个专业中的学生名单
利用rs2从学生成绩总库中取出某一学生成绩
str=select * from xsjbxxz where o_zymc='" & txtzy.text & "'"
rs1.open str
t_xh=o_xh
if not rs1.recordcount()>0 then
do while not rs1.eof()
str=select * from xscjzb where o_xh='" & t_xh & "' order by o_xq"
rs2.open str
if rs2.recordcount()>0 then
……
怎么修改才能达到要求?
遇到这样一个问题
在按专业打印学生毕业成绩单时,按学期的课程要在一行内打印,如英语是四个学期要打印在一行中,怎么才能实现?
我是利用rs1是取出一个专业中的学生名单
利用rs2从学生成绩总库中取出某一学生成绩
str=select * from xsjbxxz where o_zymc='" & txtzy.text & "'"
rs1.open str
t_xh=o_xh
if not rs1.recordcount()>0 then
do while not rs1.eof()
str=select * from xscjzb where o_xh='" & t_xh & "' order by o_xq"
rs2.open str
if rs2.recordcount()>0 then
……
怎么修改才能达到要求?
解决方案 »
- 这条语句如何写~select top 1 * from openquery(A,'select top * from netplu where plucode like 780096%')
- 请教高手在VB中启动录制宏
- 问题不大?!
- 哪里可以搞到开发 IRC聊天室客户端 的资料?
- ★★关于List ,每问 20 分.★★
- N1 = n - 1: N2 = n - 2 什么意思?
- VB能做网页监控程序吗?
- 如果实现在类里让一个public型函数返回一个type(结构)的变量
- 各位朋友请帮忙,,,非常的急!!!!
- 请问哪里有水晶报表的控件下载?谢谢!
- 请问高手,使用microsoft office web componets 9.0做报表,没有预览?急!!!
- 请问在VB6中如何调用。NET写的XML WebService ?
打印到excel要在引用中加入excel的引用.microsoft excel9.0 object libraryPrivate Sub btExcel_Click()
Dim xlApp As Excel.Application
Dim xlBook As Excel.Workbook
Dim xlSheet As Excel.Worksheet
Set xlApp = CreateObject("Excel.Application")
Set xlBook = xlApp.Workbooks.Add
Set xlSheet = xlBook.Worksheets(1)' Make Excel visible through the Application object.
xlApp.Application.Visible = True
' Place some text in the first cell of the sheet.
xlApp.Cells(1, 1).Value = "This is column A, row 1"
For i = 5 To 10
For j = 5 To 100
xlSheet.Cells(i, j).Value = i * j
Next
Next' xlSheet.Range("E5:J10").Select
xlApp.Charts.Add
xlApp.ActiveChart.ChartType = xlColumnClustered
xlApp.ActiveChart.SetSourceData Source:=xlSheet.Range("E5:J10"), PlotBy _
:=xlRows
xlApp.ActiveChart.Location Where:=xlLocationAsObject, Name:="Sheet1"' Save the sheet to C:\test.doc directory.
xlBook.SaveAs "C:\ TEST.xls"
' Close Excel with the Quit method on the Application object.
xlApp.Application.Quit
' Release the object variable.
Set xlSheet = Nothing
Set xlBook = Nothing
Set xlApp = Nothing
End Sub
在xlSheet.Cells(i, j).Value后面加入要打印的内容就可以了
在循环中来控制