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

时间:2014-03-12 17:25:44

标签: sql .net vb.net odbc ironspeed

     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失败

我不知道它的工作正在发生什么,反之亦然,我已经花了一整天的时间

0 个答案:

没有答案