Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2003
    Location
    Chennai
    Posts
    1

    Exclamation Unanswered: Connecting Sybase ASE 11 with VB.NET

    Dear all,
    I'm trying to connect Sybase ASE 11.X with Microsoft VB.NET. I have also downloaded the ODBC add-in component for .NET and then i have written the following code

    I'm able to establish the connection the connection to the sybase server but i'm not able to execute any query..

    Please Help

    Try
    Dim cn As New Microsoft.Data.Odbc.OdbcConnection()
    Dim dr As Microsoft.Data.Odbc.OdbcDataReader
    Dim qry As String
    qry = "select lnm_num from c_lstnum where lnm_code='150'"

    cn.ConnectionString = "Driver={INTERSOLV 3.11 32-BIT Sybase};SRVR=sblsyb;DB=sales;UID=salsys;PWD=salsys "
    cn.Open()
    MsgBox("Connection Opened")

    Dim cmd As New Microsoft.Data.Odbc.OdbcCommand()
    cmd.CommandText = qry
    cmd.Connection = cn


    dr = cmd.ExecuteReader(CommandBehavior.Default)
    While dr.Read
    MessageBox.Show(dr(0))
    End While
    dr.Close()
    cn.Close()

    Catch odbcex As Microsoft.Data.Odbc.OdbcException
    Dim err As Microsoft.Data.Odbc.OdbcError
    For Each err In odbcex.Errors
    MessageBox.Show(err.Message)
    Next
    End Try

    These are the errors it get when i execute the above piece of code

    [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

    [INTERSOLV][ODBC SQL Server driver][SQL Server]ct_cursor(CLOSE):user api layer: external error: This type of command cannot be batched with the command already intialized on the command structure

    thanks in advance
    Gowtham

  2. #2
    Join Date
    Feb 2002
    Location
    Willy is on vacation
    Posts
    1,208
    ASE .NET driver will soon go beta end of this month. Check out the www.sybase.com end of August for registration in the beta pgm.

    Cheers,

    Willy

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •