Showing posts with label network. Show all posts
Showing posts with label network. Show all posts

Saturday, February 25, 2012

Communication Link Failure?

Hai,

Iam using VC++ application to connect remote database(MSSQL) through network.

Everything works fine, if the network connection is active. If the network breaks and resumes, the application throws "Communication Link Failure" and do not get connected even after the network is resumed.

Client :

* Windows 2000 Professional

* MDAC 2.5

* VC++, using framework- CRecordset to access database

* PEER to PEER network configuration

* DSN through ODBC

Server :

* Windows 2000 Professional

* MDAC 2.8

* MSSQL Server

how to resume the database connection ?

Any one help me?

Thanks in advance,

If an existing connection fails due to broken network connectivity the client application must open a new connection to the server.

Does the new connection fail as well? If so, what is the full error message text?

|||

No..if the application is restarted the connection resumes..

Do i have to make a new connection after the broken network connectivity? Is there any other solution without reconnecting?

|||

Yes, you have to make a new connection after the broken network connectivity.

|||Thank you..

Communication Link failure

Hello,
Sometimes my application accessing SQL Server via ODBC is giving an error message "Communication link failure".
The network and server looks fine, but I'am still getting it time to time.
Please recommend possible reasons and solutions.
Thanks indvance.We has some unnoticed unstable connections very difficult to find because NT retried to connect without warning (maybe just some lattency when you tried to access again a lan resource).
We checked with "ping -w5000 -t"
The problem was bad coupling male/female RJ45 connectors in some stations.

Hope this helps,
Csar.

Communication Link Failure

Why would we get a " Communication Link Failure "
I have seen " TimeOut Expired " and General Network Error and can
understand why we get those, but what about the one listed in subject
Any idea ?
Hi Hassan,
Did you ever find a solution to your problem? I had that same issue
today. I did some research and I found some FAQ that stating:
" Make sure that your largest column is the last column retuned. Make
sure that you do not have any columns returned after a text or an image
column"
I kind of don't fully understand it, but in my case.. I had some columns
will a NULL value at the end of the table. I moved them and it seemed
to fix my problem. Here's the site that I found:
http://www.15seconds.com/faq/ODBC/692.htm
Marc F.
Hassan wrote:
> Why would we get a " Communication Link Failure "
> I have seen " TimeOut Expired " and General Network Error and can
> understand why we get those, but what about the one listed in subject
> Any idea ?
>

Communication Link Failure

Why would we get a " Communication Link Failure "
I have seen " TimeOut Expired " and General Network Error and can
understand why we get those, but what about the one listed in subject
Any idea ?Hi Hassan,
Did you ever find a solution to your problem? I had that same issue
today. I did some research and I found some FAQ that stating:
" Make sure that your largest column is the last column retuned. Make
sure that you do not have any columns returned after a text or an image
column"
I kind of don't fully understand it, but in my case.. I had some columns
will a NULL value at the end of the table. I moved them and it seemed
to fix my problem. Here's the site that I found:
http://www.15seconds.com/faq/ODBC/692.htm
Marc F.
Hassan wrote:
> Why would we get a " Communication Link Failure "
> I have seen " TimeOut Expired " and General Network Error and can
> understand why we get those, but what about the one listed in subject
> Any idea ?
>

Friday, February 24, 2012

communication encryption questions

it has been requested that network traffic be encrypted for a new
database coming. this db will be going onto a server that has many
databases on it and currently does not use network protocol encryption.
we use only tcp/ip protocol for db traffic. we have a variety of
applications hitting various databases including powerbuilder, iis,
access, vb. if i turn on encryption in the server network utility,
will all tcp/ip traffic from these other apps become encrypted?Question:
if i turn on encryption in the server network utility,
will all tcp/ip traffic from these other apps become encrypted?
Answer:
Yes. If you only want certain applications to encrypt the traffic, then
enable Force Protocol encryption at the client or change the connection
string.
276553 HOW TO: Enable SSL Encryption for SQL Server 2000 with Certificate
Server
http://support.microsoft.com/?id=276553
Thanks,
Kevin McDonnell
Microsoft Corporation
This posting is provided AS IS with no warranties, and confers no rights.

Sunday, February 19, 2012

Commit and Rollback?

Hi,

I'm using an SQL Express database over a network, using a C# Express program. So I had to use pure SQL connections and commands instead of using Data Sources (couldn't find a way for it to work). In the program / DB I've got a couple of Master - Detail situations. Something like:

Product:

--

productID

(...)

Acessories:

-

acessID

(...)

ProductAcess:

--

productID

acessID

So when inserting a new Product, I'll have to first insert the product (with product name, price, and so on) and once I get the product ID from the insert command, I'll insert the ProductAcess rows. I've found a problem in this though. If for some reason the insert of the product is successful, but the insert of ProductAcess

fails, I've got a big mess in hands because I'll have a row in Product with no rows in ProductAcess (which shouldn't happen in my program scenario). I could solve this by deleting all rows from the DB which connected in someway to the product that failed to insert, but would be far better and correct if I used a commit command at the end of the insert commands to make sure only the right data would be inserted (saving time and resources). I use this all the time in Oracle databases, but don't know if it is possible in SQL Express... Is it? How? Thanks

hi,

you can use transactions in Ado.Net as well, similarly to the trivial code snippet like

SqlConnection con = new SqlConnection(""); SqlCommand cmd = new SqlCommand(); SqlTransaction tx = con.BeginTransaction; cmd.Connection = con; cmd.Transaction = tx; int Res = cmd.ExecuteNonQuery(); cmd.Dispose; cmd = null; if (Res == 0) tx.Rollback; else tx.Commit; tx.Dispose; tx = null; con.Dispose; con = null;

regards