on 2017 Jan 04 2:49 PM
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
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
Request clarification before answering.
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 🙂
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
52 | |
6 | |
5 | |
5 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.