Showing posts with label hai. Show all posts
Showing posts with label hai. 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..

Friday, February 24, 2012

Communication betwee two tables

Hai,

I am having a query that i want to communicate two tables that
one is school table & other is class table as shown below

school table:
Class strength
LKG 30
UKG 40

class table:(LKG)

Rollno name
1 rohit
2 baba

Now my query is that as i defined strength of the LKG class as 30, if
i insert 31st in to LKG i need to get error, that not to enter. That
implies that when i am going to enter 31 student in LKG table it should
not accept asthe data corresponding to the school table.Is it possible,
if it say the coding, as i am new to SQL plz help me in coding.

thanks,
lucky.lucky (j.v.s.s.baba@.gmail.com) writes:
> I am having a query that i want to communicate two tables that
> one is school table & other is class table as shown below
>
> school table:
> Class strength
> LKG 30
> UKG 40
>
> class table:(LKG)
>
> Rollno name
> 1 rohit
> 2 baba
> Now my query is that as i defined strength of the LKG class as 30, if
> i insert 31st in to LKG i need to get error, that not to enter. That
> implies that when i am going to enter 31 student in LKG table it should
> not accept asthe data corresponding to the school table.Is it possible,
> if it say the coding, as i am new to SQL plz help me in coding.

Wait here, you are saying that you have one table LKG, one table UKG etc?
That is not a correct design. Rather you should have a table classes
with a primary key (classcode, rollno).

Once there, you can have a trigger on the classes table:

CREATE TRIGGER class_tri ON classes FOR INSERT, UPDATE AS
IF EXISTS (SELECT *
FROM school s
JOIN (SELECT c.classcode, cnt = COUNT(*)
FROM classes c
WHERE EXISTS (SELECT *
FROM inserted i
WHERE i.classcode = c.classcode)) AS c
ON s.class = c.classcode
WHERE c.cnt > s.strength)
BEGIN
ROLLBACK TRANSACTION
RAISERROR('One or more classes are over-booked.', 16, 1)
RETURN
END

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||homework.

Thursday, February 16, 2012

Comment on Replication

Hai friends

Could u pleas give me some noites on replication . I worked out thru
wizards but not succeded.

With thanks
Raghu"Raghuraman" <raghuraman_ace@.rediffmail.com> wrote in message
news:66c7bef8.0401052000.d18a12b@.posting.google.co m...
> Hai friends
> Could u pleas give me some noites on replication . I worked out thru
> wizards but not succeded.

It would be easier if you described what you tried and what worked or didn't
work.

> With thanks
> Raghu