Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL, Access + VB

Status
Not open for further replies.

EscapeUK

Programmer
Jul 7, 2000
438
GB
I have a VB app (uses MTS) which saves data to a SQL DB with no problems at all. However when I run a long MS access Query against the DB and try to save using my VB app the VB app bombs out.

Seems to be a problem in running the MS Access (uses SQL ODBC connetion) and the VB app at the same time. I guess people must do this all the time.

Any ideas
 
You might find that the long Access query is causing locks on one of the tables in the database (access has a habit of doing that). If thie is the case and VB is tring to write to one of the tables, it might well timeout.

Check
a) locks on the database when running the access query.
b) Error code in VB/MTS when doing the save.
c) Stepping through VB code and find where it bombs out.

Hope this helps,

Chris Dukes
 
I went to tools, options, advanced but it was set to no record locks
 
If something is causing the table to be locked how do i over come this
 
You need to check under SQLServer rather than access:

Under Enterprise Manager for SQL Server, Select the appropiate Database Server, Select Management - Current Activity - Lock/Object.

This should indicate what tables are locked and by who.

Process Info contains the spid of who is connected and form where. The spid will then be indicated in the locks view.

Chris Dukes
 
Sadley this is very random so it is difficult to catch this.

Anyway of preventing locking?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top