数据库错误 [英] database error
问题描述
我将密码放在数据库中.(访问数据库)
当我要在程序中打开它时.我收到此以下错误:
无法启动您的应用程序.缺少 workship workgroup 信息文件
或由其他用户专门打开."
请帮助我
------------------------------我的代码------------------ ----------------
I put my password on the database.(access database)
When I want it to open within the program. I get this Following error:
"cannot start your application.the workshipworkgroup information file is missing
or opened exclusively by another user."
please help me
------------------------------My code----------------------------------
Imports System.Data
Imports System.Data.OleDb
Public Class Form1
Dim cnnOLEDB As New OleDbConnection
Dim cmdOLEDB As New OleDbCommand
Dim cmdInsert As New OleDbCommand
Dim cmdUpdate As New OleDbCommand
Dim cmdDelete As New OleDbCommand
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Try
Dim strConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
System.Environment.CurrentDirectory & "\data.mdb;Password=ehsan"
cnnOLEDB.ConnectionString = strConnectionString
cnnOLEDB.Open()
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
End Class
[修改:您不会在常规标签中添加常规文本]
[Modified: you don''t put regular text into pre tags]
推荐答案
如果您使用密码保护了整个访问数据库,则需要使用
If you password protected the whole access database, then you need to use
Dim strConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
System.Environment.CurrentDirectory & "\data.mdb;Jet OLEDB:Database Password=ehsan"
该错误表明正在使用工作组信息文件.如果上面的修复程序不起作用,请查看以下内容:常见数据访问页部署错误 [
The error is saying that it is expecting a workgroup information file. If the fix above doesn''t work, then look here: Common data access page deployment Errors[^]
这篇关于数据库错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!