title: LDAP SQLite communication or link
body: <p>I have openLDAP server up and running locally, I have a C API that connects to it and also queries   it, Also I have a Sqlite Database setup using ODB which is a ORM unlike hibernate in Java.
  Now, I am supposed to pull data from LDAP server, and insert it into the Sqlite server.
  I have tried some stuff that I found online, but nothing worked.
  I am totally new to all this.
  Any help will be widely appreciated</p>
  
  <p>This is the code I am using to query LDAP server. I need to put the data that I get from here into a sqlite database through an object. I dont have any idea how to do that. </p>
  
  <pre><code>rc = ldap_search_ext_s( ld, BASEDN, SCOPE, FILTER, NULL, 0,NULL, NULL, NULL, 0, &amp;result );
  if ( rc != LDAP_SUCCESS ) { 
    fprintf(stderr, "ldap_search_ext_s: %s\n", ldap_err2string(rc)); return -1;
  }
  for (e=ldap_first_entry(ld, result); e!=NULL; e=ldap_next_entry(ld, e)){
    if ((dn=ldap_get_dn( ld, e )) != NULL){
      printf("dn: %s\n", dn);
      ldap_memfree(dn);
    }
  }
  ldap_msgfree(result);
  </code></pre>