vb中mshflexgrid控件的使用 10
OptionExplicitPublicfMainFormAsMDIForm1PubliccnnAsNewADODB.ConnectionPublicConstStrAp...
Option Explicit
Public fMainForm As MDIForm1
Public cnn As New ADODB.Connection
Public Const StrAppName = "DataMiner"
Public arr() As Integer
Public data() As Integer
Sub Main()
On Error GoTo Unconnect
cnn.ConnectionTimeout = 10 's
cnn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\db1.mdb;Persist Security Info=False"
cnn.CursorLocation = adUseClient
cnn.Open
MDIForm1.Show
Exit Sub
Unconnect:
MsgBox "数据库连接失败,请检查设置!", vbCritical + vbOKOnly
Set cnn = Nothing
Exit Sub
End Sub
以上是我的程序代码!不知道问什么会出现以下错误
“无效行值”的错误提示!请在线的高手们给指点指点!
谢谢了!急用! 展开
Public fMainForm As MDIForm1
Public cnn As New ADODB.Connection
Public Const StrAppName = "DataMiner"
Public arr() As Integer
Public data() As Integer
Sub Main()
On Error GoTo Unconnect
cnn.ConnectionTimeout = 10 's
cnn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\db1.mdb;Persist Security Info=False"
cnn.CursorLocation = adUseClient
cnn.Open
MDIForm1.Show
Exit Sub
Unconnect:
MsgBox "数据库连接失败,请检查设置!", vbCritical + vbOKOnly
Set cnn = Nothing
Exit Sub
End Sub
以上是我的程序代码!不知道问什么会出现以下错误
“无效行值”的错误提示!请在线的高手们给指点指点!
谢谢了!急用! 展开
1个回答
2010-01-07
展开全部
MSHFlexGrid1.DataSource=RS
有没有关连一个Rs?(ADODB.Recordset)
你的代码中,我只能分析你有打开一个 ADODB.Connection,但并没有将数据库表关联到MSHFlexGrid表中
有没有关连一个Rs?(ADODB.Recordset)
你的代码中,我只能分析你有打开一个 ADODB.Connection,但并没有将数据库表关联到MSHFlexGrid表中
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询