SQL_ERROR while connecting to SQL server

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf SQL_ERROR while connecting to SQL server

  • Creator
    Topic
  • #52568
    Irfan Qureshi
    Participant

      I am trying to connect to SQL 2000 server from Cloverleaf 5.8 on AIX but getting “SQL_ERROR” error. The required paremeters are passed in the following commands in my tcl proc.

      variable dbname “SARP” ;# Data source name

      variable User “NewUser” ;# SQL Server User

      variable Passwd “xx123xx” ;# SQL Serer User Password

      variable err “” ;# Catch ODBC errors

      odbc SQLAllocHandle SQL_HANDLE_ENV SQL_NULL_HANDLE henv

      odbc SQLSetEnvAttr $henv SQL_ATTR_ODBC_VERSION SQL_OV_ODBC3 0

      odbc SQLAllocHandle SQL_HANDLE_DBC $henv hdbc

      set err [odbc SQLConnect $hdbc $dbname SQL_NTS $User SQL_NTS $Passwd SQL_NTS]

      echo $err

      The following is the portion of ODBC.ini file

      [SARP]

      Driver=/hci/cis5.8/integrator/lib/Connect6.0/lib/ivmsss24.so

      Description=DataDirect 6.0 SQL Server Wire Protocol

      Address=123.456.789.174,1433

      AlternateServers=

      AnsiNPW=Yes

      ConnectionRetryCount=0

      ConnectionRetryDelay=3

      Database=paris

      FetchTSWTZasTimestamp=0

      FetchTWFSasTime=0

      LoadBalancing=0

      LogonID=

      Password=

      QuotedId=No

      ReportCodepageConversionErrors=0

      ReportDateTimeENGINE=1

      SnapshotSerializable=0

      I am not sure if I am missing anything or if I could find more information on where the issue is. If someone has run into this issue and resolved it, please share your findings and troubleshooting information on this.

    Viewing 4 reply threads
    • Author
      Replies
      • #74702
        Jim Kosloskey
        Participant

          Do you use sqlGetDiagrec to get clarification of the SQL_ERROR?

          That is where I would start.

          email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.

        • #74703
          Irfan Qureshi
          Participant

            Hi Jim,

            SQLGetDiagrec and SQLGetDiagField commands seem to be for diagnosing errors associated with a database record as RecNumber needs to be provided as one of the parameters. I am not sure if there is a diagnostic command to show details on this issue of database connection error.

            Thanks.

          • #74704
            Jim Kosloskey
            Participant

              Try this:

              odbc SQLGetDiagRec SQL_HANDLE_DBC $hdbc 1 SqlState NativeError MessageText 1024 TextLength

              This is what I use for my test odbc connection Tcl proc and it works fine.

              email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.

            • #74705
              Jim Kosloskey
              Participant

                If you want my command line Tcl proc to test connectivity email me. At least you will have something to look at.

                email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.

              • #74706
                Donna Bailey
                Participant

                  Jim,

                  Could you please send me the tcl that you use?  I have proc that is working on 5.4 and now I am trying to test on 5.8.  I’m hoping your proc will help me troubleshoot.

                  Thanks,

                  dledgerwood@micro-star-inc.com

                  Donna Bailey
                  Tele: 315-729-3805
                  dbailey@microstar.health
                  Micro Star Inc.

              Viewing 4 reply threads
              • The forum ‘Cloverleaf’ is closed to new topics and replies.