I seem to connect fine to Sybase through my VB.NET app, but when I run a
query I get this error message:
"[INTERSOLV][ODBC SQL Server driver][SQL Server]ct_con_props(SET,NETIO):
user api layer: external error: The buflen parameter must be set to
CS_UNUSED."
From my research I guess this is a known bug in Sybase and can be fixed
two ways. First by Updating the Open Client to 11.1.1 or by setting the
CursorDriver to rdUseIfNeeded. I pasted some code below from VB 6.0 that
uses this code and it does work fine. I'd like to use the code below in
my VB.NET app, but don't know how to set the cursor driver in .NET. I've
also pasted the code I'm using in .NET to connect, if someone could show
me an example...thanks
VB Code:
Set grdoSybase = New rdoConnection With grdoSybase .Connect = "DSN=SBPROD;UID=" & logon & ";PWD=" & LCase(txtPassword) .CursorDriver = rdUseIfNeeded .QueryTimeout = 120 .EstablishConnection rdDriverNoPrompt End With
VB Code:
Dim strConSybase As String = "DSN=SBPROD;Server=SYBASE;DB=fmsprod;Password=test;User ID=test" Dim objConSyBase As New OdbcConnection(strConSybase) Dim objComSyBase As New OdbcCommand(sqlcmd, objConSyBase) Try objConSyBase.Open() objDR2 = objComSyBase.ExecuteReader If objDR.Read = True Then gerror_flag = True Else gerror_flag = False End If Catch ex As Exception MsgBox("FMS Validation Error: " & Err.Description)




Reply With Quote