Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Problem with a VB6 app using DAO

Author  Topic 

juliano.net
Starting Member

10 Posts

Posted - 2006-11-07 : 08:21:26
Hi, my friend has an application developed using Visual Basic 6.0 and DAO 3.5. This application is being used by several companies near our city, but one of these companies are having problems.

One of the tables from the application database (SQL Server 2000) sometimes doesn't open (via SELECT), so I created a procedure that Kill all connections, shrink the database and execute sp_checkdb. After using this procedure everything works, but sp_checkdb do not find any errors.

What can it be?

[]'s
Juliano
.Net Developer

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-11-07 : 08:23:31
Try to rewrite application and use ADO if possible.


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2006-11-07 : 08:24:06
Make sure some other process doesn't hold exclusive lock on this table, that prevents it from opening. Shrinking the db and executing sp_checkdb seems unnecessary to me.

Harsh Athalye
India.
"Nothing is Impossible"
Go to Top of Page

Lumbago
Norsk Yak Master

3271 Posts

Posted - 2006-11-07 : 08:33:43
Killing all connections is probably what's resolving your issue and this should be a method of last resort. Try to utilize the NOLOCK hint when troubleshooting and see if that works:
SELECT Something 
FROM table1 WITH (NOLOCK)
INNER JOIN table2 WITH (NOLOCK)
...
If this works your table is locked by some long running process and that's where you need to start debugging.

--
Lumbago
"Real programmers don't document, if it was hard to write it should be hard to understand"
Go to Top of Page

juliano.net
Starting Member

10 Posts

Posted - 2006-11-07 : 09:44:35
Peter, rewritting the application is impossible, they won't spend money and time doing this (I know that using DAO with SQL is a mistake, but they understand this).

[]'s
Juliano
.Net Developer
Go to Top of Page
   

- Advertisement -