473,486 Members | 1,953 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

VB2005 - Kill Connection to Database

5 New Member
Hi.
I'm using VB 2005 Express Edition and made a database using SQL SERVER 2005 Express Edition. I'm trying to copy that database used inside my program to an alternate location but in the DEBUG mode I keep getting the message that the file is in use even though I have made .close() procedure.
The original database is located in c:\XXX\RADS_DB.mdf and I want to copy it c:\XXX_UP\RADS_DB.mdf
I use the my.computher.filesystem.copyfile method.
Thanks in advance,

bbetoo
Mar 28 '07 #1
2 1057
shweta123
692 Recognized Expert Contributor
Hi,

Can you please specify your coding? Have you closed all the connections from the code?

Also it is possible that Database is opened itself.
Mar 28 '07 #2
bbetoo
5 New Member
Thaks for the reply.
I actually closed all connections using:
connBD.close()
The code is the following:

Public strcon as string = "Data Source=.\SQLEXPRESS;AttachDbFilename=c:\XXX\RADS_D B.mdf;Integrated Security=true; Connect Timeout=30;User Instance=True"
Private connBD as SqlConnection
Private sub routine()
dim connBD as new SqlConnection(strcon)
connBD.open()
'routine using the database
connBD.close()
my.computer.filesystem.copyfile(c:\XXX\RADS_DB.mdf ,c:\XXX_UP\RADS_DB.mdf)
end sub

it keeps giving me the error that program is using the file RADS_DB.mdf in the debug mode.

thanks in advance,

bbetoo

Hi,

Can you please specify your coding? Have you closed all the connections from the code?

Also it is possible that Database is opened itself.
Mar 28 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

7
2989
by: Krisa | last post by:
I've begun using the technique of putting temporary tables in a temporary database in my C:\Temp folder. Everything is fine except I can't kill the database when exiting Access. I get a...
2
8973
by: Fabrice | last post by:
Hello, I 'would like to build a system (based on database, not SqlServer but MySQL) to permit only one session per user. I'm using a form athentication. My Solution : --------------- When...
5
3692
by: Chris Devol | last post by:
My dial-up connection sometimes hangs up and has to re-connect. The VB2005 installer/downloader apparently doesn't know how to resume when the connection is re-established. It just aborts! I've...
2
1501
by: saroxonline76 | last post by:
Dear all, I installed Visual Basic 2005 Express and SqlServer Express. I tried some features of both of them but I'm not able to connect a databse through a network. To explain, I have two...
2
4001
by: Miles | last post by:
I have a VB2005 application that has the need to read FoxPro 2.5 DBF/CDX files. I have the code (below) that opens the connection, but there are never any records, nor errors, reported... Can...
7
1612
by: Rich | last post by:
Hello, I have an SP that inserts data into a sqlserver table. If a condition is not met within the SP after the data has been inserted into the table, the SP will rollback the insert. If I...
92
3235
by: =?Utf-8?B?bW9iaWxlbW9iaWxl?= | last post by:
I'm trying to load this structure for a call to DeviceIoControl: typedef struct _NDISUIO_QUERY_OID { NDIS_OID Oid; PTCHAR ptcDeviceName; UCHAR Data; } NDISUIO_QUERY_OID, *PNDISUIO_QUERY_OID; ...
1
5140
by: ManningFan | last post by:
If one of my end users has left their database open and I need to compact it, is there a way (via code or something else) to boot a user from a database and clear the LDB file? I'm pretty sure...
2
3838
by: Edwintanst | last post by:
I am trying out the detaching of the database and found that there are active user connection to it. The connection has lead to the failed in detaching the database. Can I know how do I kill that...
0
7099
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6964
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7123
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7175
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7319
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4559
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3069
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
598
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
262
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.