Re: Difference between tsql and libsybdb
"James K. Lowden" <[email protected]>
| Newsgroups | gmane.comp.db.tds.freetds |
|---|---|
| Message-ID | <[email protected]> |
On Mon, 24 Sep 2012 16:49:22 +0200 Alberto Pulvirenti <[email protected]> wrote: > > Look at the login process for bsqldb. Also perhaps try the source > > code from the Tenderfoot section of the UG. It sounds like your > > server may require you to call dboption() before dbopen(). > > > > Thanks for this suggestion, but since I am noob in this respect, can > you explain me how I can look at this? > And what's the UG (and its tenderfood section)? The source code for bsqldb is in src/apps/bsqldb.c in your FreeTDS source tree. The UG is in the doc directory and was installed when you ran "make install". (Where depends on how it was configured.) The Tenderfoot guide to DB-Library is part of the UG. The UG for the current release is online at http://www.freetds.org/userguide/samplecode.htm. These resources are intended to make your db-lib programming easier. > I have thought that maybe I could need dboption()'s but I didn't > manage to find a help about what options to set, how and what is > their meaning. A complete db-lib reference manual proved to be more work than your friendly maintainer could do. The incomplete one can still help, though, if only because it's a complete list of the implemented functions. If you follow the Documentation link on the website, you'll find the reference manual. Once you know the function name -- in this case dbsetopt(), not dboption(), sorry -- then I normally search the web for the name. Microsoft's and Sybase's manuals usually show up in the first few hits. > Looking slightly more in detail, I found that the login packet sent > by my application to that server is an XML block (since I am not the > owner of the credentials I hide them): > > <EVENT_INSTANCE><EventType>LOGON</EventType><PostTime>2012-09-20T15:43:17.147</PostTime><SPID>385</SPID><ServerName> > [...]</ServerName><LoginName>[...]</LoginName><LoginType>SQL > Login</LoginType><SID>[...] > </SID><ClientHost>192.168.235.238</ClientHost><IsPooled>0</IsPooled></EVENT_INSTANCE> > You will find the layout of the login packet also among the documents on the website. The login packet is not XML, thank heaven. You application does not send a login packet at all if it uses db-lib. The library sends the packet (correctly formed) when you call dbopen(). HTH. --jkl