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

Home Posts Topics Members FAQ

oledb problem in vb.net

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
ct******@pierceassociates.com

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 OLEDB:Database
Password=;Provider='Microsoft.Jet.OLEDB.3.51';Pers ist 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 OLEDB:Database
Password=;Provider='Microsoft.Jet.OLEDB.4.0';Persi st 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_MAT ERIALS)

Catch ex As Exception

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

myAccessConn = ""

'myAccessConn = "Jet OLEDB:Registry Path=;User ID=Admin;Jet OLEDB:Database
Password=;Provider='Microsoft.Jet.OLEDB.3.51';Pers ist 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_MAT ERIALS)

End Try

Jul 21 '05 #1
3 1820
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
ct******@pierceassociates.com
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
OLEDB:Database Password=;Provider='Microsoft.Jet.OLEDB.3.51';Pers ist
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
OLEDB:Database Password=;Provider='Microsoft.Jet.OLEDB.4.0';Persi st
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_MAT ERIALS)

Catch ex As Exception

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

myAccessConn = ""

'myAccessConn = "Jet OLEDB:Registry Path=;User ID=Admin;Jet
OLEDB:Database Password=;Provider='Microsoft.Jet.OLEDB.3.51';Pers ist
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_MAT ERIALS)

End Try


Jul 21 '05 #2
Just to make others aware not to open two messages and investigate them.
Jul 21 '05 #3
On Mon, 20 Sep 2004 16:08:44 -0400, "Chris Thunell" <ct******@pierceassociates.com> 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
¤ ct******@pierceassociates.com
¤

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 ~~~ pc******@ameritech.net
Microsoft MVP (Visual Basic)
Jul 21 '05 #4

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

Similar topics

12
by: Parking Meters | last post by:
Today I managed to get the OleDB provider to let me put datasets from an as400 using sql. Great, the provider string I used is: Provider=IBMDA400.DataSource.1;User ID=XXXXX;Password=XXXX;Data...
4
by: NS | last post by:
Hi, I am trying to execute a prepare statement using oledb provider for DB2. The command.Prepare() statement is giving me an exception " No error information available:...
2
by: Joe | last post by:
Hi All, I am new to using the Access DB and I need some help if someone is able to give it to me. What I want to do is get the names of the columns of certain tables. Not the data in the table...
9
by: Pam Ammond | last post by:
I need the code to update the database when Save is clicked and a text field has changed. This should be very easy since I used Microsoft's wizards for the OleDBAdapter and OleDBConnection, and...
1
by: T8 | last post by:
I have a asp.net (framework 1.1) site interfacing against SQL 2000. It runs like a charm 99% of the time but once in a while I get the following "unspecified error". Sometimes it would resolve by...
3
by: Brian Foree | last post by:
I am developing an ASP.NET application that uses Access 2000 as its backend, and have just started getting the following error on 2 ASP.NET pages that had been working until late last week (and I...
2
by: Martin | last post by:
Hi, I currently have an application that connects to an MS ACCESS database. This application uses an OLEDB connection string for MS ACCESS. Now, I'd like to upsize the application so I converted...
0
by: NicK chlam via DotNetMonster.com | last post by:
this is the error i get System.Data.OleDb.OleDbException: Syntax error in INSERT INTO statement. at System.Data.Common.DbDataAdapter.Update(DataRow dataRows, DataTableMapping tableMapping) at...
3
by: Chris Thunell | last post by:
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...
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
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
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
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
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.