ADODC控件+MSHFlexGrid控件访问ACCESS表,不显示了 我用ADODC控件+MSHFlexGrid控件访问ACCESS表.在本机器上调试通过,可以查询和显示.把程序拷贝到被的机器运行,发现点查询后,没有反映,MSHFlexGrid控件没有任何显示,为什么啊. 环境是VB6+office2000.高手帮忙解决,在线等.... 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 控件 都copy 到别的机器上没有啊 检查你的adodc控件连接数据库的路径 Private myConn As New ADODB.ConnectionPrivate myRecord As New ADODB.RecordsetOption ExplicitPrivate conADO As ConnectionPrivate rsADO As RecordsetPrivate Sub Command1_Click()Dim curTime As StringDim curmonth, curday, curhour, curminute, cursecond As StringcurTime = Text1.Textcurmonth = IIf(Month(curTime) < 10, "0" & Month(curTime), Month(curTime))curday = IIf(Day(curTime) < 10, "0" & Day(curTime), Day(curTime))Text1.Text = Year(curTime) & "-" & curmonth & "-" & curdaycurTime = Text2.Textcurmonth = IIf(Month(curTime) < 10, "0" & Month(curTime), Month(curTime))curday = IIf(Day(curTime) < 10, "0" & Day(curTime), Day(curTime))Text2.Text = Year(curTime) & "-" & curmonth & "-" & curdayDim biaoname As String'"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\Program Files\水浒Q传数据库\数据库备份\" + Combo1.Text + ".mdb;Persist Security Info=False"Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + App.Path + "\db1.mdb;Persist Security Info=False"Adodc1.RecordSource = "select ALM_DESCR as 描述,ALM_VALUE AS 值,ALM_DATEIN AS 报警开始日期,ALM_TIMEIN AS 报警开始时间,FIXAL.ALM_ALMSTATUS as 报警状态 from FIXAL where ALM_DESCR like '%" & Combo1.Text & "%' and ALM_DATEIN >= '" + Text1.Text + "' and ALM_DATEIN <= '" + Text2.Text + "'"On Error GoTo ConnErr Adodc1.Refresh MSHFlexGrid1.Refresh Exit SubConnErr: MsgBox "数据库连接错误!", vbExclamation, "错误"End Sub控件都在机器上注册过了 代码就这个 帮忙看看 路径也没问题吧 Private myConn As New ADODB.ConnectionPrivate myRecord As New ADODB.RecordsetOption ExplicitPrivate conADO As ConnectionPrivate rsADO As RecordsetPrivate Sub Command1_Click()Dim curTime As StringDim curmonth, curday, curhour, curminute, cursecond As StringcurTime = Text1.Textcurmonth = IIf(Month(curTime) < 10, "0" & Month(curTime), Month(curTime))curday = IIf(Day(curTime) < 10, "0" & Day(curTime), Day(curTime))Text1.Text = Year(curTime) & "-" & curmonth & "-" & curdaycurTime = Text2.Textcurmonth = IIf(Month(curTime) < 10, "0" & Month(curTime), Month(curTime))curday = IIf(Day(curTime) < 10, "0" & Day(curTime), Day(curTime))Text2.Text = Year(curTime) & "-" & curmonth & "-" & curdayDim biaoname As StringAdodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + App.Path + "\db1.mdb;Persist Security Info=False"Adodc1.RecordSource = "select ALM_DESCR as 描述,ALM_VALUE AS 值,ALM_DATEIN AS 报警开始日期,ALM_TIMEIN AS 报警开始时间,FIXAL.ALM_ALMSTATUS as 报警状态 from FIXAL where ALM_DESCR like '%" & Combo1.Text & "%' and ALM_DATEIN >= '" + Text1.Text + "' and ALM_DATEIN <= '" + Text2.Text + "'"On Error GoTo ConnErr Adodc1.Refresh MSHFlexGrid1.Refresh Exit SubConnErr: MsgBox "数据库连接错误!", vbExclamation, "错误"End Sub本机器运行没问题 代码正常,你单步调试走一下看看。另外Formt(curtime,"YYYY-MM-DD")即可把curtime转换成2006-02-02的格式 “把程序拷贝到被的机器运行”不知道这是什么意思?程序是要打包发布的,光拷贝exe是不行的。 我运行后提示"找不到可安装的ISAM",是什么意思? 读取记事本中特定字符的一行? 如何用GID+对一个PNG图片进行缩放和保存(VB6.0)? 在Excel中写宏,可以读ini文件么? 有关VB中对word的操作 关于ASP与VB之间的通讯 游戏的窗口怎么捕获 exe文件出错,在VB下运行没有问题,不知道是什么原因。请大家帮忙!! 如何检测当前的网络连接状态?我用的是ADO,在线等,急! dategrid显示数据库中的记录为什么第一条记录的第一个属性自动改为空 3个不太难的问题。谢谢。必给分 有个判断数据库是否已经打开的小问题,在线等~~~~~~~~~~~~~~~~~~~~~~~ 以下數據如何填入treeview中
Private myRecord As New ADODB.Recordset
Option Explicit
Private conADO As Connection
Private rsADO As Recordset
Private Sub Command1_Click()
Dim curTime As String
Dim curmonth, curday, curhour, curminute, cursecond As String
curTime = Text1.Text
curmonth = IIf(Month(curTime) < 10, "0" & Month(curTime), Month(curTime))
curday = IIf(Day(curTime) < 10, "0" & Day(curTime), Day(curTime))
Text1.Text = Year(curTime) & "-" & curmonth & "-" & curdaycurTime = Text2.Text
curmonth = IIf(Month(curTime) < 10, "0" & Month(curTime), Month(curTime))
curday = IIf(Day(curTime) < 10, "0" & Day(curTime), Day(curTime))
Text2.Text = Year(curTime) & "-" & curmonth & "-" & curdayDim biaoname As String
'"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\Program Files\水浒Q传数据库\数据库备份\" + Combo1.Text + ".mdb;Persist Security Info=False"
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + App.Path + "\db1.mdb;Persist Security Info=False"Adodc1.RecordSource = "select ALM_DESCR as 描述,ALM_VALUE AS 值,ALM_DATEIN AS 报警开始日期,ALM_TIMEIN AS 报警开始时间,FIXAL.ALM_ALMSTATUS as 报警状态 from FIXAL where ALM_DESCR like '%" & Combo1.Text & "%' and ALM_DATEIN >= '" + Text1.Text + "' and ALM_DATEIN <= '" + Text2.Text + "'"
On Error GoTo ConnErr
Adodc1.Refresh
MSHFlexGrid1.Refresh
Exit Sub
ConnErr:
MsgBox "数据库连接错误!", vbExclamation, "错误"
End Sub控件都在机器上注册过了
Private myConn As New ADODB.Connection
Private myRecord As New ADODB.Recordset
Option Explicit
Private conADO As Connection
Private rsADO As Recordset
Private Sub Command1_Click()
Dim curTime As String
Dim curmonth, curday, curhour, curminute, cursecond As String
curTime = Text1.Text
curmonth = IIf(Month(curTime) < 10, "0" & Month(curTime), Month(curTime))
curday = IIf(Day(curTime) < 10, "0" & Day(curTime), Day(curTime))
Text1.Text = Year(curTime) & "-" & curmonth & "-" & curdaycurTime = Text2.Text
curmonth = IIf(Month(curTime) < 10, "0" & Month(curTime), Month(curTime))
curday = IIf(Day(curTime) < 10, "0" & Day(curTime), Day(curTime))
Text2.Text = Year(curTime) & "-" & curmonth & "-" & curdayDim biaoname As StringAdodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + App.Path + "\db1.mdb;Persist Security Info=False"Adodc1.RecordSource = "select ALM_DESCR as 描述,ALM_VALUE AS 值,ALM_DATEIN AS 报警开始日期,ALM_TIMEIN AS 报警开始时间,FIXAL.ALM_ALMSTATUS as 报警状态 from FIXAL where ALM_DESCR like '%" & Combo1.Text & "%' and ALM_DATEIN >= '" + Text1.Text + "' and ALM_DATEIN <= '" + Text2.Text + "'"
On Error GoTo ConnErr
Adodc1.Refresh
MSHFlexGrid1.Refresh
Exit Sub
ConnErr:
MsgBox "数据库连接错误!", vbExclamation, "错误"
End Sub
本机器运行没问题