0
     Dim cnnStr As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + filepath + filename
               Dim cnn As OleDbConnection = New OleDbConnection(cnnStr)
                    Try
                        cnn.Open()
                    Catch ex As Exception
                        cnnStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + filepath + filename
                        cnn = New OleDbConnection(cnnStr)
                        cnn.Open()
                    End Try
Dim ConnectionString As String = "Trusted_Connection=no;Server=AMAZONA-RPKEMQI;Database=ContactManager;Uid=sa;Pwd=Sql12345;"

                    Dim Accesscmd As New OleDbCommand
                    Accesscmd.Connection = cnn
                    'Accesscmd.CommandText = "SELECT * INTO [Email] FROM [Email] IN '' [ODBC;Driver={SQL Server Native Client 10.0};Server=servername;Database=ContactSync;Trusted_Connection=no;Uid=sa;Pwd=sa123;];"
                    ''Data Source=ADDIS16\SA;Database=ContactSync;Trusted_Connection=no;User Id=sa;Password=88888" providerName="System.Data.SqlClient" />
                    'Accesscmd.ExecuteNonQuery()
                    Try
                        Accesscmd.Connection.Open()
                    Catch ex As Exception
                        Accesscmd.Connection = cnn
                    End Try

                    Accesscmd.CommandText = " SELECT * INTO [tbl Industry] FROM [Industries] IN '' [ODBC;Driver={SQL Server Native Client 10.0};" & ConnectionString & "];"
                    Accesscmd.ExecuteNonQuery()

您好,我正在尝试将 oledb mdf 数据源连接到通过 Ironspeed 导出,但是它的某些行为很奇怪,例如第一次运行良好,第二次抛出错误

odbc 连接 sql server 本机客户端 10.0 失败

我不知道发生了什么,反之亦然

4

0 回答 0