Menu

ODBC

2004-08-23
2004-08-24
  • Nobody/Anonymous

    Hi,
    Can use ODBC to connect a database.
    I see that only use Mysql, slqClient and oledb.

     
    • Richard Banks

      Richard Banks - 2004-08-23

      Not at this stage, but it's a simple matter to write it.

      You can wait for me to do it (put a request in the RFE section) or you can write it yourself (I'd appreciate the code if you do). It's pretty much a matter of copying the msaccess (oledb) one and changing the references to odbc.

      I probably won't be able to do it for a week or two as I am travelling at the moment.

      - Richard

       
    • Richard Banks

      Richard Banks - 2004-08-23

      Actually, never mind that last message.

      I've already added the code and updated CVS.

      To use the ODBC data source set the class to CODBCDatabase in the XML file, and set the "name" parameter to the ODBC connection string.

      I've used a connection string here, instead of requesting parameters as there are too many variables in the way ODBC connections are made.

      - Richard.

       
    • Nobody/Anonymous

      But, the code for odbc, only oledb, mysql and sqlclient exist.
      I need code for ODBC or not

       
      • Richard Banks

        Richard Banks - 2004-08-24

        Yes you will need the ODBC code, but you need to get it from CVS.  Specifically you need to get the latest versions of
        CConnection.vb
        CODBCDatabase.vb
        AtomsFramework.vbproj

        It wouldn't hurt to get CPersistenceBroker.vb and CCacheEntry.vb as they contain a few bug fixes from the 1.20 release.

        If you can't get the code from CVS for whatever reason send me your email address and I can mail you a zip file with the latest code in it.

        - Richard

         
    • Nobody/Anonymous

      my email is vhsg@hotmail.com.
      how can i contributor.
      Escuseme, but my english is bad

       
      • Richard Banks

        Richard Banks - 2004-08-24

        Contributions are always welcome.  The policy is that you make a number of smaller contributions either as patches or via the forums.

        Once you have made a number of successful contributions I'd be happy to add you as a developer.

         
    • Nobody/Anonymous

      Hi,
      Very good, the conection by ODBC is correct.But, the field oid in the each table is necesary?, My table has the following structure:
      CREATE TABLE "ERPG"."TIPOPORTE"
      ("CODIGOTIPOPORTE" Integer    NOT NULL,
          "NOMBRE"  Varchar (100) ASCII    NOT NULL,
          "IDEMPLEADO" Integer,
          PRIMARY KEY ("CODIGOTIPOPORTE"))

      CodigotipoPorte is my primary key, My XML is the following one:

      <?xml version="1.0" encoding="utf-8" ?>
      <map>
          <database name="erp" class="CODBCDatabase">
              <parameter name="name" value="DRIVER={SAP DB};SERVER=kersan20;DATABASE=ERP;UID=ERP;PWD=ERP"/>
              <parameter name="user" value="erp" />
              <parameter name="password" value="erp" />
              <parameter name="OIDTable" value="OID"/>
          </database>   
          <class name="TipoPorte" table="tipoporte" database="erp">
              <attribute name="OIDValue" column="codigotipoporte" key="primary"/>
              <attribute name="Nombre" column="nombre"/>   
          </class>   
      </map>

      When i try save an object, I obtain the following mistake (couln't find a oidavalue in the database).

      How i can do that my primary key it your oid.

      the CreatedDate and ModifiedDate column is correct, but OID ?

      Saludos
      Victor

       
    • Richard Banks

      Richard Banks - 2004-08-24

      Hi Victor,

      The OID table is only required if you are using OIDs as a method of key abstraction.

      In your situation the attribute name in class TipoPorte should be codigotipoporte (assuming that is the name of the property in the class).

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.