运行时错误'-2147467259(80004005)'找不到文件Account.mdb [英] Run- time error '-2147467259 (80004005)' Could not find file Account.mdb

查看:173
本文介绍了运行时错误'-2147467259(80004005)'找不到文件Account.mdb的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hii all 这是我的实验室程序(用于验证数据库中的用户名和密码并显示相应消息的vb程序)使用数据控件

Hii all   this is my lab program (vb program to validate the user name and password from the database and display the appropriate message) use Data control

我得到运行时错误'-2147467259( 80004005)'找不到文件'C:\Program Files(x86)Microsoft Visual Studio \VB98 \Account.mdb

i getting  Run- time error '-2147467259 (80004005)' Could not find file 'C:\Program Files (x86)Microsoft Visual Studio\VB98\Account.mdb

我的代码是 

My code is 

Dim rs As New ADODB.Recordset

Dim conn As New ADODB.Connection

Private Sub cmdexit_Click()

MsgBox"你真的想要退出","vbInformation + vbOKOnly,"登录"和"b $ b"如果是vbOK那么
b $ b结束

结束如果

结束子

私有子cmdlogin_Click()

如果Text1.Text =""然后

MsgBox"输入用户名",vbInformation + vbOKOnly,"登录"

Text1.SetFocus

退出Sub

结束如果

如果Text2.Text =""然后

MsgBox"输入密码",vbInformation + vbOKOnly," login"

Text2.SetFocus

退出Sub

结束如果

如果Text1.Text<> ""和Text2.Text<> ""然后

如果rs.State = 1那么

rs.Close

否则

rs.Open" select *来自登录名,其中username ='" &安培; Text1& "'和密码='" &安培; Text2& "'",conn,adOpenDynamic,adLockOptimistic,adCmdText

结束如果

如果rs.EOF = True则为
MsgBox"无效用户名和密码",vbCritical + vbOKOnly," login"

Text1.Text =""

Text2.Text =""

Text1.SetFocus

Else

MsgBox"用户名和密码正确",vbInformation + vbOKOnly," login"

结束If

结束如果

结束子

私人子Form_Load()

conn.Open" provider = microsoft。 jet.oledb.4.0; data source =" &安培; App.Path& " \ Account.mdb; persist security info = false"

End Sub

Dim rs As New ADODB.Recordset
Dim conn As New ADODB.Connection
Private Sub cmdexit_Click()
MsgBox "do u really want to exit", vbInformation + vbOKOnly, "login"
If vbOK Then
End
End If
End Sub
Private Sub cmdlogin_Click()
If Text1.Text = "" Then
MsgBox "enter the username", vbInformation + vbOKOnly, "login"
Text1.SetFocus
Exit Sub
End If
If Text2.Text = "" Then
MsgBox "enter the password", vbInformation + vbOKOnly, "login"
Text2.SetFocus
Exit Sub
End If
If Text1.Text <> "" And Text2.Text <> "" Then
If rs.State = 1 Then
rs.Close
Else
rs.Open "select * from login where username='" & Text1 & "' and password= '" & Text2 & "' ", conn, adOpenDynamic, adLockOptimistic, adCmdText
End If
If rs.EOF = True Then
MsgBox "invalid username and password", vbCritical + vbOKOnly, "login"
Text1.Text = ""
Text2.Text = ""
Text1.SetFocus
Else
MsgBox "username and password correct", vbInformation + vbOKOnly, "login"
End If
End If
End Sub
Private Sub Form_Load()
conn.Open "provider=microsoft.jet.oledb.4.0;data source=" & App.Path & "\ Account.mdb;persist security info = false"
End Sub

推荐答案

从版本7开始,程序文件文件夹受IO限制。

Since version 7 the program files folders are restricted for IO.

尝试将其移动到另一个文件夹或将该文件夹设为RW。

Try to move this to another folder or make that folder RW.


这篇关于运行时错误'-2147467259(80004005)'找不到文件Account.mdb的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆