Skip to Content.
Sympa Menu

freetds - [freetds] Res: Res: How to make a connection without freetds.conf

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Alexandre Gazola <alexandregazola AT yahoo.com.br>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: [freetds] Res: Res: How to make a connection without freetds.conf
  • Date: Wed, 18 Jul 2007 10:24:30 -0700 (PDT)

Thanks.

I tried to set the SERVERADDR property as "forte 1695" (myserver
myportnumber) and make the connection this way: ct_connect(conn_,
CS_NULLTERM, CS_NULLTERM), but I didn´t succeed.

So, I´ll keep on working with the conf file.

thank you again

Alexandre

---------------------------------------------
Part of the code I used, but which didn´t work:

ret = ct_con_props(conn_, CS_SET, CS_SERVERADDR, (char *) server_addr,
CS_NULLTERM, NULL);
if (ret != CS_SUCCEED)
{
errorMessage_ = "ct_con_props() SET SERVERADDR failed!";
return false;
}

ret = ct_connect(conn_, CS_NULLTERM, CS_NULLTERM);
if (ret != CS_SUCCEED)
{
errorMessage_ = "Connection failed!";
return false;
}


----- Mensagem original ----
De: James K. Lowden <jklowden AT freetds.org>
Para: FreeTDS Development Group <freetds AT lists.ibiblio.org>
Enviadas: Quarta-feira, 18 de Julho de 2007 11:40:28
Assunto: Re: [freetds] Res: How to make a connection without freetds.conf

Alexandre Gazola wrote:
> I´m doing the connection with FreeTDS using the function ct_connect (see
> the simple code bellow).
>
> The "host" parameter used to make the connection matches a section in
> the freetds.conf file, as specified. Is there how to modify the code
> bellow so that the freetds.conf file is not needed?

You cannot. Or, at least, it would be very difficult.

The "Host" refers to an entry in freetds.conf; in that section FreeTDS
finds the server's hostname, port, and TDS version. It then looks up the
IP address for the name, and makes the connection.

For a ct_connect reference, I recommend Sybase's online documentation.

--jkl
_______________________________________________
FreeTDS mailing list
FreeTDS AT lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds








____________________________________________________________________________________
Novo Yahoo! Cadê? - Experimente uma nova busca.
http://yahoo.com.br/oqueeuganhocomisso




Archive powered by MHonArc 2.6.24.

Top of Page