高分求解!为什么我的VB程序无法将已录入的数据保存到ACCESS数据库中???
我的程序在VB6.0下可以正常运行,是一个简单的学生信息录入程序
我在VB6.0下单击运行后,点击"录入",输入几行数据,然后点击"保存"
都没有问题,可是当我打开数据库文件时,发现没有任何数据被保存
我使用ADO控件访问数据库
请问这到底是怎么回事?
PS:下面是代码,比较多
这是main_students_edit.frm的文件中的内容
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Begin VB.Form main_students_edit
BorderStyle = 1 'Fixed Single
Caption = "学生信息录入"
ClientHeight = 6960
ClientLeft = 45
ClientTop = 420
ClientWidth = 8070
LinkTopic = "Form2"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 6960
ScaleWidth = 8070
StartUpPosition = 3 '窗口缺省
Begin VB.TextBox Text1
Height = 495
Left = 0
TabIndex = 6
Top = 360
Visible = 0 'False
Width = 1215
End
Begin VB.Frame Frame3
Height = 800
Left = 3480
TabIndex = 4
Top = 6000
Width = 4455
Begin VB.CommandButton Quit
Caption = "&Q 退出"
Height = 375
Left = 3360
TabIndex = 15
Top = 240
Width = 975
End
Begin VB.CommandButton Cancel
Caption = "&C 取消"
Height = 375
Left = 2280
TabIndex = 14
Top = 240
Width = 975
End
Begin VB.CommandButton Save
Caption = "&S 保存"
Height = 375
Left = 1200
TabIndex = 13
Top = 240
Width = 975
End
Begin VB.CommandButton Edit
Caption = "&E 录入"
Height = 375
Left = 120
TabIndex = 12
Top = 240
Width = 975
End
End
Begin VB.Frame Frame2
Height = 800
Left = 240
TabIndex = 3
Top = 6000
Width = 3135
Begin VB.CommandButton Count
Caption = "人数汇总"
Height = 375
Left = 120
TabIndex = 16
Top = 240
Width = 1095
End
Begin VB.Label Total
Alignment = 2 'Center
BorderStyle = 1 'Fixed Single
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1920
TabIndex = 11
Top = 240
Width = 800
End
Begin VB.Label Label5
Caption = "共录入 人"
Height = 255
Left = 1320
TabIndex = 10
Top = 360
Width = 1695
End
End
Begin VB.Frame Frame1
Height = 735
Left = 240
TabIndex = 2
Top = 1080
Width = 7695
Begin VB.TextBox jsr
Height = 270
Left = 960
TabIndex = 7
Top = 240
Width = 1815
End
Begin VB.Label rq
Height = 255
Left = 5160
TabIndex = 9
Top = 285
Width = 1935
End
Begin VB.Label Label3
Caption = "录入日期:"
Height = 255
Left = 3960
TabIndex = 8
Top = 285
Width = 975
End
Begin VB.Label Label2
Alignment = 2 'Center
Caption = "经手人:"
Height = 255
Left = 240
TabIndex = 5
Top = 280
Width = 855
End
End
Begin MSAdodcLib.Adodc Adodc1
Height = 375
Left = 0
Top = 3480
Visible = 0 'False
Width = 2055
_ExtentX = 3625
_ExtentY = 661
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 1
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=tickets.mdb;Persist Security Info=False"
OLEDBString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=tickets.mdb;Persist Security Info=False"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "select * from students"
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin MSFlexGridLib.MSFlexGrid MS1
Height = 3975
Left = 240
TabIndex = 1
Top = 1920
Width = 7695
_ExtentX = 13573
_ExtentY = 7011
_Version = 393216
Enabled = 0 'False
End
Begin VB.Label Label1
Caption = "学生信息录入"
BeginProperty Font
Name = "华文新魏"
Size = 42
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 855
Left = 1320
TabIndex = 0
Top = 120
Width = 5175
End
End
Attribute VB_Name = "main_students_edit"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False