Solved

Sybase Windows Command Line BCP - Driver Call To Connect Two End Points Failed

Posted on 2013-11-11
13
965 Views
Last Modified: 2013-11-13
I've been doing some Sybase stuff on Linux and have bcp in's and out's working great. Here's my working bcp out on linux:

bcp drd02.dbo.APPL_ENVIRONMENT out APPL_ENVIRONMENT.bcp -U sa -P SyAdmin  -n

When trying the same in Windows, I get the following error:

ct_connect(): network packet layer: internal net library error: Net-Lib protocol
 driver call to connect two endpoints failed

Here's a few pertinent details:

I can connect to my server via iSQL GUI. Its shown as Sybase157 0.0.0.0  5000 and my Drd02 database is online and available.

Contents of the c:\sybase\ini\sql.ini  are (I added the drd02 lines):

[Sybase157_XP]
master=NLWNSCK,0.0.0.0,5001
query=NLWNSCK,0.0.0.0,5001
drd02=NLWNSCK,0.0.0.0,5001

[Sybase157]
master=NLWNSCK,0.0.0.0,5000
query=NLWNSCK,0.0.0.0,5000
drd02=NLWNSCK,0.0.0.0,5000

[Sybase157_JSAGENT]
master=NLWNSCK,0.0.0.0,4900
query=NLWNSCK,0.0.0.0,4900



The environment variables are:

%DSQUERY%=Sybase157
%SYBASE%=c:\Sybase


No matter what I try, it's just not connecting. I'd be happy for any help that could be provided.
0
Comment
Question by:Jay Redd
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
  • 4
13 Comments
 
LVL 24

Expert Comment

by:Joe Woodhouse
ID: 39641403
Are you using exactly the same command line? If not can you show us your Windows command line?

You might need to try explicitly adding the ASE server name to the bcp command line... I don't put my faith in DSQUERY working correctly...
0
 

Author Comment

by:Jay Redd
ID: 39641789
I tried that:

bcp drd02.dbo.APPL_ENVIRONMENT out APPL_ENVIRONMENT.bcp -U sa -P SyAdmin -S Sybase157 -n

but I get the same result.
0
 
LVL 13

Expert Comment

by:alpmoon
ID: 39641900
Command line environment might be different than GUI environment. Have you tried isql on command line, whether it connects to Sybase157 or not?
0
Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

 

Author Comment

by:Jay Redd
ID: 39641956
yes, I can for example run:
    dbisql -host 123.123.123.123 -port 5000 -c "uid=sa;pwd=thepw"  \delivery\create.sql

(where 123.123.123.123 is the box's ip)
0
 
LVL 13

Accepted Solution

by:
alpmoon earned 500 total points
ID: 39642061
What about command line isql:

isql -U sa -P SyAdmin -S Sybase157

Also can you try the same with IP address like below?

isql -U sa -P SyAdmin -S 123.123.123.123:5000
0
 

Author Comment

by:Jay Redd
ID: 39642084
i have never been able to get -S 123.123.12.3:5000 to work with bcp in linux or windows, I think -S is for referring over to interface (linux) and sql.ini (windows).
0
 
LVL 13

Expert Comment

by:alpmoon
ID: 39642130
It depends on your Open Client version. I think OCS 15.5 and later works with IP address (maybe 15.0 as well).

What about command line isql, does it work?
0
 

Author Comment

by:Jay Redd
ID: 39642133
I figured it out. The fact that i could get into isql with the IP address made me think that maybe 0.0.0.0 is somehow not available to Bcp.

I modified c:\sybase\ini\sql.ini with the following:

from:
[Sybase157]
master=NLWNSCK,0.0.0.0,5000
query=NLWNSCK,0.0.0.0,5000
drd02=NLWNSCK,0.0.0.0,5000


to:
[Sybase157]
master=NLWNSCK,123.123.123.123,5000
query=NLWNSCK,0.0.0.0,5000
drd02=NLWNSCK,0.0.0.0,5000

after putting my public IP address of my vm in the sql.ini, bcp was able to speak to it correctly.
0
 

Author Comment

by:Jay Redd
ID: 39642178
I've requested that this question be closed as follows:

Accepted answer: 0 points for Beatscribe's comment #a39642133

for the following reason:

solved it myself
0
 
LVL 13

Expert Comment

by:alpmoon
ID: 39642175
Do you think that my comments didn't help you to find the soultion?
0
 

Author Closing Comment

by:Jay Redd
ID: 39642179
this helped get me there
0
 

Author Comment

by:Jay Redd
ID: 39642184
it did aplmoon, got my brain going, thanks!
0
 

Author Comment

by:Jay Redd
ID: 39645561
I should mention this is just a temporary fix, this will close off sybase_157 from outside traffic i think. you'd need a loopback adaptor or something to do it as a permanent fix.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article was originally published on Monitis Blog, you can check it  here .   Some years back, I worked as the CTO.  During my tenure, I had a head of IT support reporting to me.  He did his job quite well and had a commendable sense of duty…
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question