cancel
Showing results for 
Search instead for 
Did you mean: 

Resource files required - SQL Anywhere 17 in VS 2015

0 Kudos
4,192

I'm trying to get a web application working with a reference to Sap.Data.SQLAnywhere.v4.5 and having an issue running is locally. It works fine if deployed on the same server that 17 is installed (although it's returning data from a version 11 server as well).

I suspect the issue is it requires some more resource files (it kicked off wanting dblgen17.dll so I dropped a copy of that in resources and that error dropped) - now it's having a connection issue (0x80004005)..

Found this for an earlier edition

http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.help.sqlanywhere.12.0.1/dbprogramming/...

So I added dbgen17.dll as a resource and a reference to policy.17.0.Sap.Data.SQLAnywhere.v4.5 (that also required Sap.Data.SQLAnywhere.v4.5.config)

Still throws the same connection error

Are there any other files it requires as additional resources? Can't find this information anywhere (no pun intended)

+++++++++++++++++++++++++++++++++ EDIT TO ADD MORE DETAILS +++++++++++++++++++++++

Connection string is like this

 Public Function ReturnEng(HOAID As Integer) As String
    Try
        Dim ReturnString As String = ""
        Dim vstrSQL As String = "SELECT Connection_Name FROM HOA_Connections WHERE Connection_ID = " & HOAID
        Using Conn As New SAConnection
            Conn.ConnectionString = HASConString
            Using vCmd As New SACommand(vstrSQL, Conn)
                vCmd.CommandType = CommandType.Text
                Conn.Open()
                ReturnString = vCmd.ExecuteScalar
                Conn.Close()
            End Using

        End Using

        Return ReturnString
    Catch ex As Exception
        EmailError(ex)
        Return "Error"
    End Try
End Function

Public Function ReturnDBN(HOAID As Integer) As String
    Try
        Dim ReturnString As String = ""
        Using Conn As New SAConnection
            Conn.ConnectionString = HASConString
            Using vCmd As New SACommand("SELECT Connection_String FROM HOA_Connections WHERE Connection_ID = " & HOAID, Conn)
                vCmd.CommandType = CommandType.Text
                Conn.Open()
                ReturnString = vCmd.ExecuteScalar
                Conn.Close()
            End Using

        End Using
        Return ReturnString
    Catch ex As Exception
        EmailError(ex)
        Return "Error"
    End Try
End Function

Public Function ReturnHOST(HOAID As Integer) As String
    Try
        Dim ReturnString As String = ""
        Using Conn As New SAConnection
            Conn.ConnectionString = HASConString
            Using vCmd As New SACommand("SELECT Host_Name FROM HOA_Connections WHERE Connection_ID = " & HOAID, Conn)
                vCmd.CommandType = CommandType.Text
                Conn.Open()
                ReturnString = vCmd.ExecuteScalar
                Conn.Close()
            End Using

        End Using

        Return ReturnString
    Catch ex As Exception
        EmailError(ex)
        Return "Error"
    End Try
End Function


Public Function ReturnConnString(HOAID As Integer) As String
    Try
        Dim vConnString As String = "eng=" & ReturnEng(HOAID) & ";dbn=" & ReturnDBN(HOAID) & ";uid=MyUserName;pwd=MySecret;CommLinks=tcpip(host=" & ReturnHOST(HOAID) & ");CommBufferSize=4000;PrefetchBuffer=8192"

        Return vConnString
    Catch ex As Exception
        EmailError(ex)
        Return "Error"
    End Try
End Function

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Seems the only way I can get this to work locally is to install Anywhere v17 on the local machine - still no idea what was missing, but now it works in debug as well as deployed 🙂

Answers (0)