473,738 Members | 3,658 Online
Bytes | Software Development & Data Engineering Community
+ 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******@pierce associates.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=;Provi der='Microsoft. Jet.OLEDB.3.51' ;Persist Security
Info=False;Jet OLEDB:System database=;Jet OLEDB:Global Partial Bulk
Ops=2;Mode=Shar e Deny None;Extended
Properties=';CO UNTRY=0;CP=1252 ;LANGID=0x0409' ;Data Source='"

'myAccessConn = "Jet OLEDB:Registry Path=;User ID=Admin;Jet OLEDB:Database
Password=;Provi der='Microsoft. Jet.OLEDB.4.0'; Persist Security Info=False;Jet
OLEDB:System database=;Jet OLEDB:Global Partial Bulk Ops=2;Mode=Shar e Deny
None;Extended Properties=';CO UNTRY=0;CP=1252 ;LANGID=0x0409' ;Data Source='"

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

myAccessConn = myAccessConn & Trim(lblFileLoc ation.Text)

myAccessConn = myAccessConn & "'"

Me.OleDbConnect ion1.Connection String = myAccessConn

'open the database

Try

Me.OleDbDataAda pter1.Fill(Me.D ataSet11.BILL_O F_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 OLEDB:Database
Password=;Provi der='Microsoft. Jet.OLEDB.3.51' ;Persist Security
Info=False;Jet OLEDB:System database=;Jet OLEDB:Global Partial Bulk
Ops=2;Mode=Shar e Deny None;Extended
Properties=';CO UNTRY=0;CP=1252 ;LANGID=0x0409' ;Data Source='"

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

myAccessConn = myAccessConn & Trim(lblFileLoc ation.Text)

myAccessConn = myAccessConn & "'"

Me.OleDbConnect ion1.Connection String = myAccessConn

Me.OleDbDataAda pter1.Fill(Me.D ataSet11.BILL_O F_MATERIALS)

End Try

Jul 21 '05 #1
3 1848
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******@pierce associates.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=;Provi der='Microsoft. Jet.OLEDB.3.51' ;Persist
Security Info=False;Jet OLEDB:System database=;Jet OLEDB:Global
Partial Bulk Ops=2;Mode=Shar e Deny None;Extended
Properties=';CO UNTRY=0;CP=1252 ;LANGID=0x0409' ;Data Source='"

'myAccessConn = "Jet OLEDB:Registry Path=;User ID=Admin;Jet
OLEDB:Database Password=;Provi der='Microsoft. Jet.OLEDB.4.0'; Persist
Security Info=False;Jet OLEDB:System database=;Jet OLEDB:Global
Partial Bulk Ops=2;Mode=Shar e Deny None;Extended
Properties=';CO UNTRY=0;CP=1252 ;LANGID=0x0409' ;Data Source='"

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

myAccessConn = myAccessConn & Trim(lblFileLoc ation.Text)

myAccessConn = myAccessConn & "'"

Me.OleDbConnect ion1.Connection String = myAccessConn

'open the database

Try

Me.OleDbDataAda pter1.Fill(Me.D ataSet11.BILL_O F_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
OLEDB:Database Password=;Provi der='Microsoft. Jet.OLEDB.3.51' ;Persist
Security Info=False;Jet OLEDB:System database=;Jet OLEDB:Global
Partial Bulk Ops=2;Mode=Shar e Deny None;Extended
Properties=';CO UNTRY=0;CP=1252 ;LANGID=0x0409' ;Data Source='"

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

myAccessConn = myAccessConn & Trim(lblFileLoc ation.Text)

myAccessConn = myAccessConn & "'"

Me.OleDbConnect ion1.Connection String = myAccessConn

Me.OleDbDataAda pter1.Fill(Me.D ataSet11.BILL_O F_MATERIALS)

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******@pierc eassociates.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******@pierce associates.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******@amerit ech.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
10887
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 Source=nnn.nnn.nnn.nnn;"/> Question:
4
7809
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: DB_E_NOCOMMAND(0x80040E0C)." My code is very simple and is working with other oledb provider, like SQL Server and oracle.
2
23938
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 but the table column names. I've seen other posts that suggest using the SQL command DESCRIBE but I can't get it to work for some reason. Other posts have code samples but they're written in VB which I am not familiar with. I
9
4777
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 DataSet; and all I'm doing is showing one record in text fields, allowing the user to modify the text fields, and then updating the database again when the user clicks the Save button. The fields already show the correct data record since I have...
1
6892
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 itself (asp.net recycled?); it also can be solved by restarting IIS. Any ideas what cause(s) this to happen? System.Data.OleDb.OleDbException: Unspecified error at System.Data.OleDb.OleDbDataReader.ProcessResults(Int32 hr) at...
3
8833
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 don't think I made any changes to either page other than changing the user control that creates the header). Server Error in '/myApp' Application. ---------------------------------------------------------------------------- ----
2
2861
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 the db to SQL SERVER and this went well. Next thing I changed the connection string from OLEDB for MS ACCESS to OLEDB for SQL SERVER. I expected this to work resonably well, however I found that it never worked
0
5668
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 System.Data.Common.DbDataAdapter.Update(DataSet dataSet, String srcTable) at System.Data.Common.DbDataAdapter.Update(DataSet dataSet) at TryThis.Form1.save() in C:\Documents and Settings\Nick\My Documents\...
3
1420
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 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...
0
8968
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9473
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9259
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6750
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6053
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4824
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3279
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 we have to send another system
2
2744
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2193
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.