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

oledbprovider vs odbc provider ???

Dear all,

Does any one have any idea why an sql statment with INNER
JOIN syntax is working well with odbcprovider but not with
Oledbprovider when accessing an access 2000 database?

here is the code I have used with oledbprovider which fails

Dim monodbc As New
OleDb.OleDbConnection 'Odbc.OdbcConnection
monodbc.ConnectionString = ("Jet OLEDB:Global
Partial Bulk Ops=2;Jet OLEDB:Registry Path=;Jet
OLEDB:Database Locking Mode=1;Data Source='D:\Nomos Net
Suite\Runtime\Config\NetDBConf.mdb';Jet OLEDB:Engine
Type=5;Provider='Microsoft.Jet.OLEDB.4.0';Jet OLEDB:System
database=;Jet OLEDB:SFP=False;persist security
info=False;Extended Properties=;Mode=Share Deny None;Jet
OLEDB:Encrypt Database=False;Jet OLEDB:Create System
Database=False;Jet OLEDB:Don't Copy Locale on
Compact=False;Jet OLEDB:Compact Without Replica
Repair=False;User ID=Admin;Jet OLEDB:Global Bulk
Transactions=1")

'"MaxBufferSize=2048;FIL=MS
Access;DSN=TRYME;PageTimeout=5;UID=admin;DBQ=D:\No mos Net
Suite\Runtime\Config\NetDBConf.mdb;DriverId=25"

monodbc.Open()
Dim momo As OleDb.OleDbDataAdapter
momo = New OleDb.OleDbDataAdapter
Dim sds As OleDb.OleDbCommand

sds = New OleDb.OleDbCommand(Query, monodbc)
momo.SelectCommand = sds
Return momo.SelectCommand.ExecuteReader()

if I use exactly the same thing but with odbcprovider no
problem works ok.

regards
serge
Jul 21 '05 #1
6 2644
You have not posted the query text or the error message, but:

- The .NET Data Provider for OLE DB uses the Jet OLEDB Data Provider
- The .NET Data Provider for ODBC uses the Access ODBC Driver

The Access ODBC Driver and Jet OLEDB Data Provider are diferent components
that can parse differently the SQL statements (or to have its own bugs). A
known issue is that while the Access ODBC Driver accepts ODBC syntax (for
outer joins, for example), the Jet OLEDB Data Provider does not (other OLEDB
Providers accept ODBC syntax, though).

So, you could reduce your query text to a minimum and post it here for
examination of others...

Carlos Quintero

"serge calderara" <se*************@maillefer.net> escribió en el mensaje
news:05****************************@phx.gbl...
Dear all,

Does any one have any idea why an sql statment with INNER
JOIN syntax is working well with odbcprovider but not with
Oledbprovider when accessing an access 2000 database?

here is the code I have used with oledbprovider which fails

Dim monodbc As New
OleDb.OleDbConnection 'Odbc.OdbcConnection
monodbc.ConnectionString = ("Jet OLEDB:Global
Partial Bulk Ops=2;Jet OLEDB:Registry Path=;Jet
OLEDB:Database Locking Mode=1;Data Source='D:\Nomos Net
Suite\Runtime\Config\NetDBConf.mdb';Jet OLEDB:Engine
Type=5;Provider='Microsoft.Jet.OLEDB.4.0';Jet OLEDB:System
database=;Jet OLEDB:SFP=False;persist security
info=False;Extended Properties=;Mode=Share Deny None;Jet
OLEDB:Encrypt Database=False;Jet OLEDB:Create System
Database=False;Jet OLEDB:Don't Copy Locale on
Compact=False;Jet OLEDB:Compact Without Replica
Repair=False;User ID=Admin;Jet OLEDB:Global Bulk
Transactions=1")

'"MaxBufferSize=2048;FIL=MS
Access;DSN=TRYME;PageTimeout=5;UID=admin;DBQ=D:\No mos Net
Suite\Runtime\Config\NetDBConf.mdb;DriverId=25"

monodbc.Open()
Dim momo As OleDb.OleDbDataAdapter
momo = New OleDb.OleDbDataAdapter
Dim sds As OleDb.OleDbCommand

sds = New OleDb.OleDbCommand(Query, monodbc)
momo.SelectCommand = sds
Return momo.SelectCommand.ExecuteReader()

if I use exactly the same thing but with odbcprovider no
problem works ok.

regards
serge

Jul 21 '05 #2
here is the text queery I am using and that I forgot to join here:

SELECT USER_PARAM.*, LANGUAGE.NAME
FROM USER_PARAM INNER JOIN [LANGUAGE] ON USER_PARAM.LANGUAGE_ID =
LANGUAGE.ID;

thnaks for your comments
regards
serge

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 21 '05 #3

We have made some more testing on passing SQL synthax with inner join
statement and the only way we make it work was to use an odbcprovider.
No way to make it work with oledbprovider.

Do u have any idea if it is a know issue as we use to call it "bug".

thanks for your reply
regards
Serge
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 21 '05 #4
I have tested it on my system and my results are:

1) If you use that query, it only works with the ODBC Driver. Using the
OLEDB Provider, it returns an error opening the recordset. This seems to be
your case.
2) If you use LANGUAGE2 as the name of the table instead of LANGUAGE, it
works fine with both providers.
3) If you use [LANGUAGE] in each occurrence of this word in the statement,
that is:

SELECT USER_PARAM.*, [LANGUAGE].NAME
FROM USER_PARAM INNER JOIN [LANGUAGE] ON USER_PARAM.LANGUAGE_ID =
[LANGUAGE].ID;

instead of your original statement (which misses 2 occurrences), it works
fine with both providers.

HTH,

Carlos Quintero

"calderara serge" <se*************@maillefer.net> escribió en el mensaje
news:%2****************@TK2MSFTNGP11.phx.gbl...
here is the text queery I am using and that I forgot to join here:

SELECT USER_PARAM.*, LANGUAGE.NAME
FROM USER_PARAM INNER JOIN [LANGUAGE] ON USER_PARAM.LANGUAGE_ID =
LANGUAGE.ID;

thnaks for your comments
regards
serge

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Jul 21 '05 #5

Hello carlos,

thnaks so much it works ok now.
But I would like to clarify my mind.

Does it means that LANGUAGE is a reserved word somehow in .NEt and it
cannot be used as a table name?

Why if I just make a simple querry to LANGUAGE table only like SELECT *
FROM LANGUAGE it works ok?

thnaks for your answer
serge

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 21 '05 #6
On Fri, 31 Oct 2003 05:12:55 -0800, calderara serge <se*************@maillefer.net> wrote:

¤
¤ Hello carlos,
¤
¤ thnaks so much it works ok now.
¤ But I would like to clarify my mind.
¤
¤ Does it means that LANGUAGE is a reserved word somehow in .NEt and it
¤ cannot be used as a table name?
¤
¤ Why if I just make a simple querry to LANGUAGE table only like SELECT *
¤ FROM LANGUAGE it works ok?

Language is a reserved word in both Jet and ODBC, but apparently is being ignored in your ODBC
example:

http://support.microsoft.com/default...b;en-us;321266
http://msdn.microsoft.com/library/de...dappcpr_17.asp

You can use Language as a table name but as Carlos indicated it must be enclosed within brackets for
every occurrence in the SQL statement. It's typically best not to use reserved words to avoid these
types of problems.
Paul ~~~ pc******@ameritech.net
Microsoft MVP (Visual Basic)
Jul 21 '05 #7

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

Similar topics

1
by: David Lozzi | last post by:
This happens a lot to my databases. I store them at the root of my developing files, i.e. c:\My Projects\Proj1\database.mdb. Randomly, the security settings on this database will drop to the basic...
11
by: Wolfgang Kaml | last post by:
Hello All, I have been working on this for almost a week now and I haven't anything up my sleeves anymore that I could test in addition or change.... Since I am not sure, if this is a Windows...
0
by: MrPhil | last post by:
(SQL 2K SP3a on W2K. VFP 6 data lives on W2K. GIGABIT BACKBONE, gig cards on the data servers) I'm sure anyone who attempts to retrieve or alter FP/VFP data through a SQL link server will...
4
by: Andreas Lauffer | last post by:
Can anyone tell me advantages / disadvantages of DataDirect Server Wire ODBC-driver? Any experiences? What about redistribution? Andreas Lauffer, easySoft. GmbH, Germany
0
by: Duncan Winn | last post by:
I have written a 'very basic' .NET provider which parses SQL statements and (through COM) gets the results from my existing Borland C++ classes. However, I have existing (commercial) software...
6
by: serge calderara | last post by:
Dear all, Does any one have any idea why an sql statment with INNER JOIN syntax is working well with odbcprovider but not with Oledbprovider when accessing an access 2000 database? here is...
1
by: Crazy Cat | last post by:
Hi, I created a linked server for MS SQL Server 2005 Express to an Oracle database using the OLE DB Provider for ODBC. My ODBC Source uses the Microsoft ODBC for Oracle driver. I'm using the...
2
by: Crazy Cat | last post by:
Hi all, I am having trouble getting linked Oracle 9 server in MS SQL Server 2005 Express to work properly. My machine is running Windows XP. The Microsoft and Oracle OLE DB Providers have...
2
by: ram_palavalasa | last post by:
Hi all, I have a assignment of vc++.net and sybase to populate data and generate reports which is the best one? is OLEDB more efficient than ODBC? i think OLEDB itself is a layer on the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
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...

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.