Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Problem connection Sybase with C# !!!!

119 views
Skip to first unread message

coloso

unread,
Jan 11, 2006, 11:29:17 AM1/11/06
to
Hi to everybody, first sorry for my terrible english.

I´m trying to do a program in C# that take the data from a database in
Sybase 6.0 take all the data that I want and send this data to SAP.
I´m using "SQL Anywhere 9". I have checked the example with ADO and
ASA. I have check the program TableViewer. If I use a database running
in my pc the program work ok, the problem is when I try to access from
other compute using TCP/IP address all the time the connection string
is wrong.

Example:

using iAnywhere.Data.AsaClient;

private AsaConnection _conn;

txtConnectString.Text = "UID=DBA; PWD=SQL; DBN = prisma1;
Links=tcpip(ClientPort=2638;Host=192.30.3.83;Port=2638;Eng=prisma1)";
//Error en puerto


try{
_conn = new AsaConnection(txtConnectString.Text);
_conn.Open();
}

catch( AsaException ex ){
MessageBox.Show(ex.Message,"Failed to connect");
}

In this case the program return this error : Connection error in TCPIP
port options.

I have tested this connection strings, when is in local no problem but
if I try to access from other computer using IP address always is
wrong.

Anybody can help me with a example ??? Is it impossible do it ?????
Thanks in advance.

//string connStr = "server=192.30.3.83;user id=DBA; password=SQL;
database=mysql; pooling=false";
//"Data
source='myASEserver';Port=5000;Database='myDBname';UID='username';PWD='password';"

// string connStr =
"=192.30.3.83;Port=2638;Database=prisma1;UID=DBA;PWD=SQL";

//string connStr = "Data
Source=192.30.3.83;Port=2638;UID='DBA';PWD='SQL';Database='prisma1';Pooling=false";


//string connStr =
"Host=192.30.3.83;Port=2638;UID='dba';PWD='sql';Database='prisma1';Pooling=false;";


//string connStr = "Data Source = prisma1;UID=DBA;PWD=SQL;";
//string connStr = "Data Source = prisma1;UID=DBA;PWD=SQL;";

//string connStr =
"ServerName=asademo9;UID=DBA;PWD=SQL;DatabaseName=asademo;"; //Funciona

//string connStr =
"ServerName=prisma1;UID=DBA;PWD=SQL;DatabaseName=prisma1;"; //Funciona

//string connStr = "Data
Source=prisma1;UID=DBA;PWD=SQL;DatabaseName=prisma1;"; //Funciona

//string connStr = "Network
Address=192.30.3.83;Port=2638;UID=DBA;PWD=SQL;DatabaseName=prisma1;";

//string connStr = "Data
Source=prisma1;Host=192.30.3.83;PWD=SQL;Port=2638;UID=DBA;DatabaseName=prisma1;";

//Data
Source='myASEserver';Port=5000;Database='myDBname';UID='username';PWD='password';"

//string connStr = "Host=192.30.3.83;Port=2638;User
ID=DBA;Password=SQL;Database Name=prisma1";

//string connStr =
"DataSource=192.30.3.83:2638;Database=prisma1;UID=DBA;PWD=SQL;";

//string connStr = "Network
Address=192.30.3.83;Port=2638;Database=prisma1;UID=DBA;PWD=SQL;";
//string connStr = "DataSource=Prisma1";

//txtConnectString.Text = "Data Source = prisma1; UID=DBA; PWD=SQL";
//Funciona en local

//txtConnectString.Text = "Data Source=192.30.3.83; UID=DBA; PWD=SQL";
//Da otro error

//txtConnectString.Text = "Data Source=192.30.3.83:2638; UID=DBA;
PWD=SQL"; //Da otro error
//txtConnectString.Text = "Data Source=mut_jdiaz_n; UID=DBA; PWD=SQL";
//Da otro error
//txtConnectString.Text = "Data Source = prisma1; UID=DBA; PWD=SQL;
Pooling = false"; //Funciona en local

//Data
Source='myASEserver';Port=5000;Database='myDBname';UID='username';PWD='password';"

//txtConnectString.Text = "Data Source=192.30.3.83; UID=DBA; PWD=SQL;
Pooling = false";

//txtConnectString.Text = "Host = ´MUT_ALFPEREZ´; UID=DBA; PWD=SQL;
Pooling = false";

//CommLinks=tcpip(ClientPort=5050-5060;Host=myhost;Port=2020;Eng=myeng)

//txtConnectString.Text = "Data Source = prisma1; CON = prisma1; ENG =
192.30.3.83,2638; UID=DBA; PWD=SQL";

//txtConnectString.Text = " Links =
tcpip(ClientPort=5050-5060;Host=192.30.3.83;Port=2638;Eng=prisma1);
UID=DBA; PWD=SQL"; //Error en puerto

///txtConnectString.Text = " Links =
tcpip(Host=192.230.83.1;Port=2638;Eng=prisma1); UID=DBA; PWD=SQL";
//Error en puerto

//CommLinks=tcpip(HOST=kangaroo)

//txtConnectString.Text =
"CommLinks=tcpip(ClientPort=2638;HOST=MUT_ALFPEREZ;Port=2638;Eng=prisma1);
UID=DBA; PWD=SQL; DBN = prisma1"; //Error en puerto

//txtConnectString.Text = "UID=DBA; PWD=SQL; DBN = prisma1;
Links=tcpip(MyIP=NONE;DoBroadcast=NO;Host=MUT_ALFPEREZ;Eng=prism1;ClientPort=2638)";
//Error en puerto

//AsaConnection conn = new AsaConnection("Data
Source=MUT_ALFPEREZ;Port=2638;" + "UID=sa;PWD='';" +
"Database=prisma1;"); //Error
//conn.Open();

blra...@gmail.com

unread,
Feb 19, 2014, 4:28:05 PM2/19/14
to

> If I use a database running
> in my pc the program work ok, the problem is when I try to access from
> other compute using TCP/IP address all the time the connection string
> is wrong.


I realize this post is a few years old now, but I've been wrestling with sybase databases for a few days now and one of my first issues sounded a lot like this one.

This sounds like the difference between dbeng and dbsrv. Basically dbeng only allows connections from the local computer that is running the process, and dbsrv allows for connections from elsewhere. Don't ask me why you would ever want this, or why it doesn't throw a useful error when this is the case.
0 new messages