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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MS Jet DB engine cannot open the file ... error Why? Why? Why? 1

Status
Not open for further replies.

TxAggie90

Programmer
Oct 23, 1998
2
US
I am tring to create a db via code. When I use the code sniplet from MS, I get the following error:<br>
<br>
The Microsoft Jet database engine cannot open the file &lt;name&gt;.<br>
It is already opened exclusively by another user, or you need<br>
permission to view its data. (Error 3051)<br>
<br>
The code that I am using is listed below:<br>
<br>
'If previous database file exists, then delete it<br>
strCheckFileName = Dir(FileName)<br>
If strCheckFileName &lt;&gt; "" Then<br>
Kill FileName<br>
End If<br>
<br>
'Create the database<br>
Set WS = DBEngine.Workspaces(0)<br>
Set DB = WS.CreateDatabase(FileName, _<br>
dbLangGeneral) 'VB breaks on this line.<br>
<br>
The help file for this error says that someone else may be using the database and therefore cannot open the file. However, since the file does not and has never existed (and even if it did, it would have been deleted), how is this possible?<br>
<br>
What am I missing????
 
Nevermind. Just made a stupid mistake, by passing the address of my CD-Rom as the file name (D: is my 2nd HD on my work computer)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top