473,761 Members | 9,284 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

Nov 21 '05 #1
3 1420
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


Nov 21 '05 #2
Just to make others aware not to open two messages and investigate them.
Nov 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)
Nov 21 '05 #4

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

Similar topics

0
1910
by: Error while executing SP | last post by:
Hi, I am getting an error while executing a sp from Oracle database. Can you let me know what could be the problem? here is the code using(System.Data.OleDb.OleDbConnection cn = new System.Data.OleDb.OleDbConnection()) { cn.ConnectionString="Provider=OraOLEDB.Oracle;Password=STORED_OBJ;User ID=STORED_OBJ;Data Source=PDCDGL1.NA.HPFS.COM;Extended Properties=;Persist Security Info=False;PLSQLRSet=1;"; cn.Open(); //String strProcName =...
3
1852
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...
12
10888
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
7811
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
23940
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
6896
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
8835
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
2866
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
5672
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\...
0
9554
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
9376
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9988
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9923
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,...
0
9811
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8813
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6640
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
5266
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
3509
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.