PC Review


Reply
Thread Tools Rate Thread

oledb problem in vb.net

 
 
Chris Thunell
Guest
Posts: n/a
 
      20th Sep 2004
I have a program where i connect to an access database and get some
information out of it. I'm using the oledb.3.51 version, my computer
doesn't seem to have the 4.0 version, but the computer that is trying to run
it only have the 4.0 version. So as you will see with the code below, i
first try to open the 4.0 version... if that doesn't work, do the 3.51
version. When i run the program from my computer... the 4.0 fails and it
goes to the 3.51 and it works fine. On his computer NEITHER version works.

Is there anyway to either include my oledb version in the program, OR get
the version of oledb on the computer running that program.. and use that in
the connection string?

Thanks!
Chris Thunell
http://www.pcreview.co.uk/forums/(E-Mail Removed)

Code (Please excuse the numerous rem out statements... i've been trying all
kinds of combinations):
Dim myprovider As String

Dim myAccessConn As String

'myAccessConn = "Jet OLEDB:Registry Path=;User ID=Admin;Jet OLEDBatabase
Password=;Provider='Microsoft.Jet.OLEDB.3.51';Persist Security
Info=False;Jet OLEDB:System database=;Jet OLEDB:Global Partial Bulk
Ops=2;Mode=Share Deny None;Extended
Properties=';COUNTRY=0;CP=1252;LANGID=0x0409';Data Source='"

'myAccessConn = "Jet OLEDB:Registry Path=;User ID=Admin;Jet OLEDBatabase
Password=;Provider='Microsoft.Jet.OLEDB.4.0';Persist Security Info=False;Jet
OLEDB:System database=;Jet OLEDB:Global Partial Bulk Ops=2;Mode=Share Deny
None;Extended Properties=';COUNTRY=0;CP=1252;LANGID=0x0409';Data Source='"

myAccessConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source='"

myAccessConn = myAccessConn & Trim(lblFileLocation.Text)

myAccessConn = myAccessConn & "'"

Me.OleDbConnection1.ConnectionString = myAccessConn

'open the database

Try

Me.OleDbDataAdapter1.Fill(Me.DataSet11.BILL_OF_MATERIALS)

Catch ex As Exception

MessageBox.Show("4.0 didn't work - Trying 3.51")

myAccessConn = ""

'myAccessConn = "Jet OLEDB:Registry Path=;User ID=Admin;Jet OLEDBatabase
Password=;Provider='Microsoft.Jet.OLEDB.3.51';Persist Security
Info=False;Jet OLEDB:System database=;Jet OLEDB:Global Partial Bulk
Ops=2;Mode=Share Deny None;Extended
Properties=';COUNTRY=0;CP=1252;LANGID=0x0409';Data Source='"

myAccessConn = "Provider=Microsoft.Jet.OLEDB.3.51;Data Source='"

myAccessConn = myAccessConn & Trim(lblFileLocation.Text)

myAccessConn = myAccessConn & "'"

Me.OleDbConnection1.ConnectionString = myAccessConn

Me.OleDbDataAdapter1.Fill(Me.DataSet11.BILL_OF_MATERIALS)

End Try



 
Reply With Quote
 
 
 
 
Antonio
Guest
Posts: n/a
 
      21st Sep 2004
Hello Chris,

I need a little more information on this one... can you replace you generic Exception with an oledbexception, and post it here?

> I have a program where i connect to an access database and get some
> information out of it. I'm using the oledb.3.51 version, my computer
> doesn't seem to have the 4.0 version, but the computer that is trying
> to run it only have the 4.0 version. So as you will see with the code
> below, i first try to open the 4.0 version... if that doesn't work, do
> the 3.51 version. When i run the program from my computer... the 4.0
> fails and it goes to the 3.51 and it works fine. On his computer
> NEITHER version works.
>
> Is there anyway to either include my oledb version in the program, OR
> get the version of oledb on the computer running that program.. and
> use that in the connection string?
>
> Thanks!
> Chris Thunell
> (E-Mail Removed)
> Code (Please excuse the numerous rem out statements... i've been
> trying all
> kinds of combinations):
> Dim myprovider As String
> Dim myAccessConn As String
>
> 'myAccessConn = "Jet OLEDB:Registry Path=;User ID=Admin;Jet
> OLEDBatabase Password=;Provider='Microsoft.Jet.OLEDB.3.51';Persist
> Security Info=False;Jet OLEDB:System database=;Jet OLEDB:Global
> Partial Bulk Ops=2;Mode=Share Deny None;Extended
> Properties=';COUNTRY=0;CP=1252;LANGID=0x0409';Data Source='"
>
> 'myAccessConn = "Jet OLEDB:Registry Path=;User ID=Admin;Jet
> OLEDBatabase Password=;Provider='Microsoft.Jet.OLEDB.4.0';Persist
> Security Info=False;Jet OLEDB:System database=;Jet OLEDB:Global
> Partial Bulk Ops=2;Mode=Share Deny None;Extended
> Properties=';COUNTRY=0;CP=1252;LANGID=0x0409';Data Source='"
>
> myAccessConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source='"
>
> myAccessConn = myAccessConn & Trim(lblFileLocation.Text)
>
> myAccessConn = myAccessConn & "'"
>
> Me.OleDbConnection1.ConnectionString = myAccessConn
>
> 'open the database
>
> Try
>
> Me.OleDbDataAdapter1.Fill(Me.DataSet11.BILL_OF_MATERIALS)
>
> Catch ex As Exception
>
> MessageBox.Show("4.0 didn't work - Trying 3.51")
>
> myAccessConn = ""
>
> 'myAccessConn = "Jet OLEDB:Registry Path=;User ID=Admin;Jet
> OLEDBatabase Password=;Provider='Microsoft.Jet.OLEDB.3.51';Persist
> Security Info=False;Jet OLEDB:System database=;Jet OLEDB:Global
> Partial Bulk Ops=2;Mode=Share Deny None;Extended
> Properties=';COUNTRY=0;CP=1252;LANGID=0x0409';Data Source='"
>
> myAccessConn = "Provider=Microsoft.Jet.OLEDB.3.51;Data Source='"
>
> myAccessConn = myAccessConn & Trim(lblFileLocation.Text)
>
> myAccessConn = myAccessConn & "'"
>
> Me.OleDbConnection1.ConnectionString = myAccessConn
>
> Me.OleDbDataAdapter1.Fill(Me.DataSet11.BILL_OF_MATERIALS)
>
> End Try
>


 
Reply With Quote
 
 
 
 
Cor Ligthert
Guest
Posts: n/a
 
      21st Sep 2004
Just to make others aware not to open two messages and investigate them.


 
Reply With Quote
 
Paul Clement
Guest
Posts: n/a
 
      21st Sep 2004
On Mon, 20 Sep 2004 16:08:44 -0400, "Chris Thunell" <(E-Mail Removed)> wrote:

I have a program where i connect to an access database and get some
information out of it. I'm using the oledb.3.51 version, my computer
doesn't seem to have the 4.0 version, but the computer that is trying to run
it only have the 4.0 version. So as you will see with the code below, i
first try to open the 4.0 version... if that doesn't work, do the 3.51
version. When i run the program from my computer... the 4.0 fails and it
goes to the 3.51 and it works fine. On his computer NEITHER version works.

Is there anyway to either include my oledb version in the program, OR get
the version of oledb on the computer running that program.. and use that in
the connection string?

Thanks!
Chris Thunell
(E-Mail Removed)


I would highly recommend updating to the most current version of Jet (4.0). You may also need to
distribute/install this version on the computers where your application is to be available.

http://support.microsoft.com/default...b;en-us;239114


Paul ~~~ (E-Mail Removed)
Microsoft MVP (Visual Basic)
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Oledb VS Sql. Oledb works with Sql Server; Sql doesn't...why mrmagoo Microsoft VB .NET 5 29th Mar 2006 01:32 AM
Excel OLEDB problem... Terry Mulvany Microsoft Excel Discussion 2 15th Apr 2005 08:18 AM
Excel OLEDB format problem... Terry Mulvany Microsoft Excel Programming 0 12th Apr 2005 06:44 PM
Re: OleDb problem with MSDAORA.1 problem Paul Clement Microsoft ADO .NET 0 1st Jul 2004 04:16 PM
oledb & windows 98 error(oledb not registered on local machine) =?Utf-8?B?bW1i?= Microsoft ADO .NET 1 23rd May 2004 04:40 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:38 PM.