473,386 Members | 1,830 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Have I found a bug in VB.Net 2005 ADOX.Catalog?

When I use the code below to create an mdb (access database) I am
unable to release it and the locking file remains persistent. For my
app this is bad if the user tries to delete the mdb later on.

Has anyone encountered this scenario? Is this a bug? I am using VB.Net
2005. Is there any way to get out of this jam? Currently my app will
only release its hold on the mdb after the app closes. I do not
understand.

Please help as I am on a deadline on Monday morning and am in a HUGE
pickle.

Dim catNewDB As New ADOX.Catalog
XMLFILE = strFi & "\merchantable" & strDate & strTime
catNewDB.Create("Provider=Microsoft.Jet.OLEDB.4.0; " & "Data Source=" &
XMLFILE & ".mdb;")
catNewDB = Nothing

There is no member of ADOX to drop, close, destruct the connection.

Thanks for any help you can provide.

Peace

The Mad Ape
Jul 12 '08 #1
7 2521
The Mad Ape wrote:
When I use the code below to create an mdb (access database) I am
unable to release it and the locking file remains persistent. For my
app this is bad if the user tries to delete the mdb later on.

Has anyone encountered this scenario? Is this a bug? I am using VB.Net
2005. Is there any way to get out of this jam? Currently my app will
only release its hold on the mdb after the app closes. I do not
understand.

Please help as I am on a deadline on Monday morning and am in a HUGE
pickle.

Dim catNewDB As New ADOX.Catalog
XMLFILE = strFi & "\merchantable" & strDate & strTime
catNewDB.Create("Provider=Microsoft.Jet.OLEDB.4.0; " & "Data Source=" &
XMLFILE & ".mdb;")
catNewDB = Nothing

There is no member of ADOX to drop, close, destruct the connection.
Does catNewDB.Create(...) return the new database? If so, assigning that to a
variable might make closing the new database file easier.
Jul 12 '08 #2
Steve Gerrard wrote:
The Mad Ape wrote:
>When I use the code below to create an mdb (access database) I am
unable to release it and the locking file remains persistent. For my
app this is bad if the user tries to delete the mdb later on.

Has anyone encountered this scenario? Is this a bug? I am using VB.Net
2005. Is there any way to get out of this jam? Currently my app will
only release its hold on the mdb after the app closes. I do not
understand.

Please help as I am on a deadline on Monday morning and am in a HUGE
pickle.

Dim catNewDB As New ADOX.Catalog
XMLFILE = strFi & "\merchantable" & strDate & strTime
catNewDB.Create("Provider=Microsoft.Jet.OLEDB.4.0 ;" & "Data Source=" &
XMLFILE & ".mdb;")
catNewDB = Nothing

There is no member of ADOX to drop, close, destruct the connection.

Does catNewDB.Create(...) return the new database? If so, assigning that to a
variable might make closing the new database file easier.

If it does I do not know how to find it.
I have further code that opens it adds new tables and data then closes
it then disposes it but the .Create also creates a connection that I can
not release.

Just using the above code and nothing else creates a lock with no way to
remove it. I am stumped. Just to let you know I even tried:

System.Runtime.InteropServices.Marshal.ReleaseComO bject(catNewDB) but
that does not work either.

Very confused and frustrated.

The Mad Ape
Jul 12 '08 #3
Mad Ape wrote:
Steve Gerrard wrote:
>The Mad Ape wrote:
>>When I use the code below to create an mdb (access database) I am
unable to release it and the locking file remains persistent. For my
app this is bad if the user tries to delete the mdb later on.

Has anyone encountered this scenario? Is this a bug? I am using
VB.Net 2005. Is there any way to get out of this jam? Currently my
app will only release its hold on the mdb after the app closes. I
do not understand.

Please help as I am on a deadline on Monday morning and am in a HUGE
pickle.

Dim catNewDB As New ADOX.Catalog
XMLFILE = strFi & "\merchantable" & strDate & strTime
catNewDB.Create("Provider=Microsoft.Jet.OLEDB.4. 0;" & "Data
Source=" & XMLFILE & ".mdb;")
catNewDB = Nothing

There is no member of ADOX to drop, close, destruct the connection.

Does catNewDB.Create(...) return the new database? If so, assigning
that to a variable might make closing the new database file easier.


If it does I do not know how to find it.
I have further code that opens it adds new tables and data then closes
it then disposes it but the .Create also creates a connection that I
can not release.

Just using the above code and nothing else creates a lock with no way
to remove it. I am stumped. Just to let you know I even tried:

System.Runtime.InteropServices.Marshal.ReleaseComO bject(catNewDB) but
that does not work either.

Very confused and frustrated.

The Mad Ape
catNewDB should have an ActiveConnection property. The doc says that if Create
succeeds, the connection to the newly created and opened database is assigned to
the catalog active connection. Using that, you should be able to close it.
Jul 12 '08 #4
Steve Gerrard wrote:
Mad Ape wrote:
>Steve Gerrard wrote:
>>The Mad Ape wrote:
When I use the code below to create an mdb (access database) I am
unable to release it and the locking file remains persistent. For my
app this is bad if the user tries to delete the mdb later on.

Has anyone encountered this scenario? Is this a bug? I am using
VB.Net 2005. Is there any way to get out of this jam? Currently my
app will only release its hold on the mdb after the app closes. I
do not understand.

Please help as I am on a deadline on Monday morning and am in a HUGE
pickle.

Dim catNewDB As New ADOX.Catalog
XMLFILE = strFi & "\merchantable" & strDate & strTime
catNewDB.Create("Provider=Microsoft.Jet.OLEDB.4 .0;" & "Data
Source=" & XMLFILE & ".mdb;")
catNewDB = Nothing

There is no member of ADOX to drop, close, destruct the connection.

Does catNewDB.Create(...) return the new database? If so, assigning
that to a variable might make closing the new database file easier.

If it does I do not know how to find it.
I have further code that opens it adds new tables and data then closes
it then disposes it but the .Create also creates a connection that I
can not release.

Just using the above code and nothing else creates a lock with no way
to remove it. I am stumped. Just to let you know I even tried:

System.Runtime.InteropServices.Marshal.ReleaseCom Object(catNewDB) but
that does not work either.

Very confused and frustrated.

The Mad Ape

catNewDB should have an ActiveConnection property. The doc says that if Create
succeeds, the connection to the newly created and opened database is assigned to
the catalog active connection. Using that, you should be able to close it.

The only thing I see is adding the line:

catNewDB.ActiveConnection = False

but that throws an error on the next line of code that is a simple
message box:

COMException was unhandled

'Arguments are of the wrong type, are out of acceptable range, or are in
conflict with one another'

System.Runtime.InteropServices.COMException was unhandled
ErrorCode=-2146825287
HelpLink="C:\WINDOWS\HELP\ADO270.CHM#1240641"
Message="Arguments are of the wrong type, are out of acceptable
range, or are in conflict with one another."
Source="ADOX.Catalog"
StackTrace:
at ADOX.CatalogClass.set_ActiveConnection(Object pVal)
I am totally perplexed here that something so simple is so complicated.

The Mad Ape
Jul 12 '08 #5
Steve Gerrard wrote:
Mad Ape wrote:
>Steve Gerrard wrote:
>>The Mad Ape wrote:
When I use the code below to create an mdb (access database) I am
unable to release it and the locking file remains persistent. For my
app this is bad if the user tries to delete the mdb later on.

Has anyone encountered this scenario? Is this a bug? I am using
VB.Net 2005. Is there any way to get out of this jam? Currently my
app will only release its hold on the mdb after the app closes. I
do not understand.

Please help as I am on a deadline on Monday morning and am in a HUGE
pickle.

Dim catNewDB As New ADOX.Catalog
XMLFILE = strFi & "\merchantable" & strDate & strTime
catNewDB.Create("Provider=Microsoft.Jet.OLEDB.4 .0;" & "Data
Source=" & XMLFILE & ".mdb;")
catNewDB = Nothing

There is no member of ADOX to drop, close, destruct the connection.

Does catNewDB.Create(...) return the new database? If so, assigning
that to a variable might make closing the new database file easier.

If it does I do not know how to find it.
I have further code that opens it adds new tables and data then closes
it then disposes it but the .Create also creates a connection that I
can not release.

Just using the above code and nothing else creates a lock with no way
to remove it. I am stumped. Just to let you know I even tried:

System.Runtime.InteropServices.Marshal.ReleaseCom Object(catNewDB) but
that does not work either.

Very confused and frustrated.

The Mad Ape

catNewDB should have an ActiveConnection property. The doc says that if Create
succeeds, the connection to the newly created and opened database is assigned to
the catalog active connection. Using that, you should be able to close it.

The only thing I see is adding the linecatNewDB.ActiveConnection = False
but that throws an error on the next line of code that is a simple
message box:

COMException was unhandled

'Arguments are of the wrong type, are out of acceptable range, or are in
conflict with one another'

System.Runtime.InteropServices.COMException was unhandled
ErrorCode=-2146825287
HelpLink="C:\WINDOWS\HELP\ADO270.CHM#1240641"
Message="Arguments are of the wrong type, are out of acceptable
range, or are in conflict with one another."
Source="ADOX.Catalog"
StackTrace:
at ADOX.CatalogClass.set_ActiveConnection(Object pVal)

I am totally perplexed here that something so simple is so complicated.

The Mad Ape
Jul 12 '08 #6
Mad Ape wrote:
The only thing I see is adding the line:

catNewDB.ActiveConnection = False

but that throws an error on the next line of code that is a simple
message box:

COMException was unhandled

'Arguments are of the wrong type, are out of acceptable range, or are
in conflict with one another'
I don't believe it meant that ActiveConnection was a boolean indicating whether
it was active or not.

ActiveConnection is a reference to the Connection object that created and opened
the database.

I would expect a call similar to

catNewDB.ActiveConnection.Close()

perhaps preceded by a check to see if ActiveConnection was not Nothing.

Jul 12 '08 #7
Steve Gerrard wrote:
Mad Ape wrote:
>The only thing I see is adding the line:

catNewDB.ActiveConnection = False

but that throws an error on the next line of code that is a simple
message box:

COMException was unhandled

'Arguments are of the wrong type, are out of acceptable range, or are
in conflict with one another'

I don't believe it meant that ActiveConnection was a boolean indicating whether
it was active or not.

ActiveConnection is a reference to the Connection object that created and opened
the database.

I would expect a call similar to

catNewDB.ActiveConnection.Close()

perhaps preceded by a check to see if ActiveConnection was not Nothing.
Ahhh .close is a member but it does not show up in the list of members
on my box. There must be a gremlin in my version of VB.Net that fails to
list all of the members available to me. Is there anyway you could
verify whether it is just on my box or is this an omission on
Microsoft's part.

The only reason I ask is that there may be more members missing.

Anyway I have it working now and can relax and have a beer. Thanks for
the help. This bugaboo was driving me crazy all day.

The Mad Ape
Jul 12 '08 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: VMI | last post by:
I'm creating an Access file with the following code, but won't let me erase it after creating it. How can I close the file immediately after creating it? ADOX.CatalogClass cat = new...
2
by: Randy | last post by:
I am trying to relink some Oracle tables in an Access database via VB.NET and ADOX. I receive the following error when executing the cat.ActiveConnection link "Arguments are of the wrong type,...
5
by: Wayne Wengert | last post by:
I am getting an error that "object no longer valid" at the point indicated in the code below - I am trying to build a table in an Access 2000 database using ADOX. Any thoughts on what might cause...
2
by: gaffar | last post by:
Hello Sir, i need the funtionality of Using ADOX to create a JET Database and tables in it and one to many relationship between the tables. Thanks for your help Gaffar.
2
by: genojoe | last post by:
Using ADOX to update a Property does not work. I want to change the Access database for a linked table. My abridged code is: Dim oCAT As ADOX.Catalog oCAT = New ADOX.Catalog...
1
by: Hexman | last post by:
I'm creating a new Access table using ADOX. I can add columns and indexes, but I'm baffled on how to change field properties. Can someone give me a hand? Want to change properties such as:...
4
devonknows
by: devonknows | last post by:
Hi can any one please help me with creating a secure database with ADO or ADOX if possible, ive got this code already but its not accessible through VisData so i cant easily modify it at all. ...
1
by: compuser45 | last post by:
Hi, I am trying to enahnce my VB6 code to be compatible with SQL Server 2005. It already is compatible with SQLServer 2000, so the transition is pretty seamless. Hwever, there is one error I am...
8
by: charli | last post by:
Error 3265, "Item cannot be found in the collection corresponding to the requested name or ordinal" code programatically opens a query using ADOX and changed the sql Dim cat As New...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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
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
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,...

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.