ODBC连接在VWD 2010调试中有效,但在发布时没有

时间:2011-03-24 22:19:39

标签: odbc

以下是我的代码: 受保护的子Page_Load(ByVal sender As Object,ByVal e As System.EventArgs)处理Me.Load

    Dim SoItem As DataSet = New DataSet
    Dim ODBCConnection As New OdbcConnection("dsn=SBT")

    Try
        Dim MyAdapter As OdbcDataAdapter
        MyAdapter = New OdbcDataAdapter("select distinct glsale from sotran01", ODBCConnection)
        MyAdapter.Fill(SoItem, "sotran01")
        ODBCConnection.Close()
        Label1.Text = SoItem.Tables("sotran01").Rows(0)("glsale").ToString
    Catch ex As Exception
        Label1.Text = ex.Message
    End Try

End Sub

这在Window 2008 Server 64bit上运行,ODBC驱动程序(MS FoxPro VFP驱动程序)安装在odbcad32中。

我能够在调试模式下从表中读取,但不能在发布中读取。 预先感谢您的帮助。 谢谢。 迈克尔

1 个答案:

答案 0 :(得分:0)

在64位系统中,有两个odbcad32:一个用于32位应用程序(c:\windows\syswow64),另一个用于64位应用程序(c:\windows\system32)。确保您的DSN在两者中均可见,然后重试。