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

VBA Jet vs. VB.NET Jet problem?

Status
Not open for further replies.

asibin2000

Programmer
Dec 10, 2007
22
US
I have a unique problem that I have not had before. I was wondering if anyone else has seen something like this.

I have a VB.NET program that uses Jet4.0 to access a table in MS-Access.

I am using .net 2.0 (vs2005 etc).

Code:
Private _ConnectionString As [String]
        Private ConStr As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0};"
        'Private ConStr As String = "Provider=Microsoft.Jet.OLEDB.4.0;"
        Private Const LOG_FILE_NAME As String = "Log.txt"
        Private _connection As OleDbConnection
        Private _command As OleDbCommand
        Private _trans As OleDbTransaction
        Private mDBPath As String = String.Empty

Ok here is the odd problem - this works 99% of my users, but I am getting 1 or two that this does not work. It has something to do with JET not working.

If I use the same exact commands in VBA (like using an Excel VBA), it works fine on the same machine - so JET 4.0 is there and working.

It has something to do with VB.NET calling JET, or something like that because I can't replicate on most machines and I can not find a consistent difference between service packs etc.

Maybe an Mdac issue? Not sure - because why would it work in Excel VBA..

Any help would be appreciated.
 
I've found if you compile a .net program that uses jet with the default settings it will not run under 64bit windows. You need to manually set it to 32bit before compiling.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top