打开数据库出错,请帮忙,谢谢

thatsgreat 2003-02-07 05:19:22
Dim temp As String

temp = App.Path + "\database.mdb;"
If MsgBox("要清空上次登记记录吗?", vbYesNo) = vbYes Then
Set mainconnection = New ADODB.Connection
Set selectallcmd = New ADODB.Command
Set currentrecordset = New ADODB.Recordset
mainconnection.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & temp & "Persist Security Info=False"
selectallcmd.CommandType = adCmdText
selectallcmd.CommandText = "select * from baseinfo"

mainconnection.Errors.Clear
mainconnection.Open '此地方出错
selectallcmd.ActiveConnection = mainconnection
If mainconnection.State <> adStateOpen Then
MsgBox "数据库打开出错!"
Exit Sub
End If
Set currentrecordset = selectallcmd.Execute
MsgBox currentrecordset.State

currentrecordset.MoveFirst
While Not currentrecordset.EOF
currentrecordset.Fields(8).Value = "//" '更新
currentrecordset.MoveNext
Wend

mainconnection.Close
MsgBox "数据库更新完毕!"

End If
Exit Sub



错误信息:
Run-time error
Cound not find installable ISAM
...全文
23 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
yefm 2003-02-07
  • 打赏
  • 举报
回复
装ISAM

1,216

社区成员

发帖
与我相关
我的任务
社区描述
VB 数据库(包含打印,安装,报表)
社区管理员
  • 数据库(包含打印,安装,报表)社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧