Не удалось загрузить файл или сборку 'driveinfoex, version=1.1.3054.15437,
Imports System.Data Imports System.Data.SqlClient Imports System.Collections.Generic Imports Microsoft.VisualBasic Imports System.IO Imports System.Data.OleDb Public Class MyADO Private connectionstring As String Public Conn As New Data.SqlClient.SqlConnection() Sub New() Dim ObjReader As StreamReader ObjReader = New StreamReader(System.AppDomain.CurrentDomain.BaseDirectory & "Taj.txt") Dim Server As String = ObjReader.ReadToEnd() 'My.Settings.ServerName Dim DataBase As String = "Keys" 'My.Settings.DataBaseName connectionstring = "Data Source=" & Server & ";Initial Catalog=" & DataBase connectionstring &= ";User Id=taj;Password=Taj_1234;" Dim Conn As New Data.SqlClient.SqlConnection(connectionstring) Try Conn.Open() Conn.Close() Catch ex As Exception 'The server was not found 'SettingsForm.MdiParent = MdiForm 'SettingsForm.ShowDialog() End Try End Sub Sub New(ByVal Server As String, ByVal Database As String) 'Dim Server As String = My.Settings.ServerName 'Dim DataBase As String = My.Settings.DataBaseName connectionstring = "Data Source=" & Server & ";Initial Catalog=" & Database connectionstring &= ";User Id=taj;Password=Taj_1234;" 'Dim Conn As New Data.SqlClient.SqlConnection(connectionstring) End Sub Public Function ExecuteNonQuery(ByVal SQL As String) As Integer Dim Conn As New SqlClient.SqlConnection(connectionstring) Dim cmd As New SqlClient.SqlCommand(SQL, Conn) If Conn.State <> ConnectionState.Open Then Conn.Open() Dim retval As Integer = cmd.ExecuteNonQuery() Conn.Close() Return retval End Function Public Function ExecuteNonQuery(ByVal SQL As String, ByVal Param() As SqlParameter) As Integer Dim Conn As New Data.SqlClient.SqlConnection(connectionstring) Dim cmd As New SqlClient.SqlCommand(SQL, Conn) If Conn.State <> ConnectionState.Open Then Conn.Open() cmd.Parameters.AddRange(Param) Dim retval As Integer = cmd.ExecuteNonQuery() Conn.Close() Return retval End Function Public Function ExecuteScalar(ByVal SQL As String) As String Dim Conn As New SqlClient.SqlConnection(connectionstring) Dim cmd As New SqlClient.SqlCommand(SQL, Conn) If Conn.State <> ConnectionState.Open Then Conn.Open() Dim retval As Object = cmd.ExecuteScalar() Conn.Close() Return IIf(IsNothing(retval) Or IsDBNull(retval), "", retval) End Function Public Function GetDataTable(ByVal SQL As String) As Data.DataTable Dim Conn As New SqlClient.SqlConnection(connectionstring) Dim dt As New Data.DataTable Dim da As New SqlClient.SqlDataAdapter(SQL, Conn) da.Fill(dt) Return dt End Function Public Sub UpdateDataTable(ByVal DataTable As DataTable, ByVal SQL As String) Dim Conn As New Data.SqlClient.SqlConnection(connectionstring) Dim Adapter As New SqlDataAdapter() Adapter.SelectCommand = New SqlCommand(SQL, Conn) If Conn.State <> ConnectionState.Open Then Conn.Open() Dim Builder As SqlCommandBuilder = New SqlCommandBuilder(Adapter) Adapter.InsertCommand = Builder.GetInsertCommand Adapter.UpdateCommand = Builder.GetUpdateCommand Adapter.DeleteCommand = Builder.GetDeleteCommand Adapter.Update(DataTable) Conn.Close() End Sub Public Function GetDataReader(ByVal SQL As String) As SqlDataReader Dim Con As New Data.SqlClient.SqlConnection(connectionstring) Dim cmd As New Data.SqlClient.SqlCommand(SQL, Con) If Con.State <> ConnectionState.Open Then Con.Open() Dim retval As SqlDataReader = cmd.ExecuteReader() Return retval End Function End Class Public Class Access Private ConnString As String Public Con As New Data.OleDb.OleDbConnection Sub New(ByVal DatabasePath As String) ConnString = "Provider=Microsoft.Jet.OLEDB.4.0;" ConnString &= "Data Source=" & DatabasePath & ";Persist Security Info=False;" Con = New Data.OleDb.OleDbConnection(ConnString) 'Con.Open() 'Con.Close() End Sub Public Function ExecuteNonQuery(ByVal SQL As String) As Integer Dim cmd As New Data.OleDb.OleDbCommand(SQL, Con) If Con.State <> ConnectionState.Open Then Con.Open() Dim retval As Integer = cmd.ExecuteNonQuery() Con.Close() Return retval End Function Public Function ExecuteScalar(ByVal SQL As String) As String Con = New Data.OleDb.OleDbConnection(ConnString) Dim cmd As New Data.OleDb.OleDbCommand(SQL, Con) If Con.State <> ConnectionState.Open Then Con.Open() Dim retval As Object = cmd.ExecuteScalar() Con.Close() Return IIf(IsNothing(retval) Or IsDBNull(retval), "", retval) End Function Public Function GetDataReader(ByVal SQL As String) As OleDbDataReader Con = New Data.OleDb.OleDbConnection(ConnString) Dim cmd As New Data.OleDb.OleDbCommand(SQL, Con) If Con.State <> ConnectionState.Open Then Con.Open() Dim retval As OleDbDataReader = cmd.ExecuteReader() Return retval Con.Close() End Function Public Function GetDataTable(ByVal SQL As String) As Data.DataTable Dim dt As New Data.DataTable Dim da As New Data.OleDb.OleDbDataAdapter(SQL, Con) da.Fill(dt) Return dt End Function End Class
Что я уже пробовал:
Цитата:Привет
Проблема очень сложная в начале операции. Это сообщение "- появляется, и все останавливается. Пожалуйста помочьЦитата:DriveInfoEx не удалось загрузить файл или сборку', версия=1.1.3054.15437, культуры=нейтральный, значения PublicKeyToken=null или один из его зависимостей. Система не может найти указанный файл.
MadMyche
Hce вы пробовали добавить ссылку на проект? Есть ли какая-то конкретная причина, по которой вы используете древний поставщик Jet 4.0 ole?