Skip to Content
author's profile photo Former Member
Former Member

Problemas con la conexión a SAP HANA

Hola,

Tengo el siguiente problema: Estoy creando un desarrollo por medio de VB.NET, y estoy tratando de crear una conexión a la base de datos SAP HANA mediante una conexión ODBC, mediante este código:...

Dim con As New Odbc.OdbcConnection("driver={HDBODBC};ServerNode=servidor:30015;uid=SYSTEM;PWD=contraseña;DATABASE=PRUEBAS;")

cn.Open()

Pero al momento de compilarlo me marca el siguiente error en la línea cn.Open() , ya agregué las siguientes referencias:

*Imports System.Data

*Imports System.Data.Odbc


¿Me estará haciendo falta una librería, o alguna otra cosa en específico?

O ¿Puedo crear la conexión entre SAP HANA y VB.NET?

pastedImage_6.png (23.2 kB)
Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Apr 23, 2015 at 07:29 PM

    Hola Axel,

    ¿Porque no usas la conexión de la DI API hacia la base de datos que deseas? De esta manera simplemente indicas en el servertype que trabajas con hana y te establece la misma.

    Espero que te sea de ayuda.

    Saludos,

    Add a comment
    10|10000 characters needed characters exceeded

    • Buenas tardes.

      Este sería el codigo de conexion en C#

         class SAPBusinessOne  
          {  
              SAPbobsCOM.Company oCompany = new SAPbobsCOM.Company();  
              public SAPBusinessOne()  
              {  
                  ConSAP();  
              }         
              private void ConSAP()  
              {  
                  oCompany.DbServerType = SAPbobsCOM.BoDataServerTypes.dst_HANADB;   
                  oCompany.DbUserName = "sa";  
                  oCompany.DbPassword = "SAP**";  
                  oCompany.Server = "sap9";  
                  oCompany.CompanyDB = "SBO9*****";  
                  oCompany.UserName = "manager";  
                  oCompany.Password = "*****";   
                  oCompany.UseTrusted = false;  
                  oCompany.language = BoSuppLangs.ln_Spanish_La;  
                  if (oCompany.Connect() != 0)  
                  {  
                      MessageBox.Show(oCompany.GetLastErrorDescription());  
                  }  
                  else  
                  {  
                      Query();  
                  }  
              }  
              private void Query()  
              {
              SAPbobsCOM.Recordset oRs = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset);
      
              string ssql = "select campo from tabla where 1=1";
      
              oRs.DoQuery(ssql);
          }
          }
      

      Saludos

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.