开发者

ODBC connection worked in VWD 2010 debug but not in release

Here are my codes: Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles 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 = SoIte开发者_如何学Cm.Tables("sotran01").Rows(0)("glsale").ToString
    Catch ex As Exception
        Label1.Text = ex.Message
    End Try

End Sub

This is running on Window 2008 Server 64bit and the ODBC driver (MS FoxPro VFP Driver) is installed in odbcad32.

I was able to read from the table in debug mode but not in release. Thank you in advance for your help. Thank you. Michael


In 64 bit systems there are two odbcad32: one for 32 bit applications (c:\windows\syswow64) and one for 64 bit applications (c:\windows\system32). Make sure your DSN is visible in both and try again.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜