473,394 Members | 1,813 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,394 software developers and data experts.

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 1813
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
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...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.