If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Opening Access db via DAO in vb.net
Hi
In my vb.net app I am trying to open a db via DAO as below; Imports dao Dim dbSynch As dao.Database dbSynch = DBEngine(0).OpenDatabase("C:\MYDB.MDB") The problem is that on the last line I am getting the error 'DBEngine' is a type and cannot be used as an expression. What am I doing wrong? Many Thanks Regards |
#2
|
|||
|
|||
Opening Access db via DAO in vb.net
Try:
Dim dbSync As DAO.Database Set dbSync = OpenDatabase("C:\MYDB.MDB") -- Arvin Meyer, MCP, MVP http://www.datastrat.com http://www.mvps.org/access http://www.accessmvp.com "John" wrote in message ... Hi In my vb.net app I am trying to open a db via DAO as below; Imports dao Dim dbSynch As dao.Database dbSynch = DBEngine(0).OpenDatabase("C:\MYDB.MDB") The problem is that on the last line I am getting the error 'DBEngine' is a type and cannot be used as an expression. What am I doing wrong? Many Thanks Regards |
#3
|
|||
|
|||
Opening Access db via DAO in vb.net
Arvin,
I have tried this one, however I never have used DAO (I used ADO) and could not get it to work. I miss this one, Dim OpenDataBase As New dao.DBEngine But did not work either. But the reason that I address this to you, is because of the fact that the Set will direct be removed from VB2008 when it is typed. Cor "Arvin Meyer [MVP]" schreef in bericht ... Try: Dim dbSync As DAO.Database Set dbSync = OpenDatabase("C:\MYDB.MDB") -- Arvin Meyer, MCP, MVP http://www.datastrat.com http://www.mvps.org/access http://www.accessmvp.com "John" wrote in message ... Hi In my vb.net app I am trying to open a db via DAO as below; Imports dao Dim dbSynch As dao.Database dbSynch = DBEngine(0).OpenDatabase("C:\MYDB.MDB") The problem is that on the last line I am getting the error 'DBEngine' is a type and cannot be used as an expression. What am I doing wrong? Many Thanks Regards |
#4
|
|||
|
|||
Opening Access db via DAO in vb.net
What am I doing wrong?
Well :-) 1 Still using Access ( i hope you have a good reasson ) 2 Is using DAO while it is already a long , long time ago declared obsolete even in the end of VB6 it was already declared as obsolete technollogy and ADO was prefered If you nowadays still use ACCESS in my opinion for new projects you should not ! but use one of the SQL engines closest to Access is the SQL CE engine , e.g. sql server everywhere then you should connect with ADO.Net. So having said this it is still possible to connect with DAO , however i will sure not recomend it to you set a reference to DAO Project=Add Reference=COM=Microsoft DAO 3.6 Object Library = dao360.dll or the 350 engine for ACCESS version 2000 Imports System.Runtime.InteropServices Dim Dbe As DAO.DBEngine Dim Db As DAO.Database Dim Rs As DAO.Recordset Dbe = New DAO.DBEngine() Db = DbE.OpenDatabase("full path to access mdb") Rs = Db.OpenRecordset("sql query or table name ") Above should work but i strongly recomend you to move to one of the sql family products as nowadays there is absolutely no valid reasson to stick with Access for newly developed products . hth Michel "John" schreef in bericht ... Hi In my vb.net app I am trying to open a db via DAO as below; Imports dao Dim dbSynch As dao.Database dbSynch = DBEngine(0).OpenDatabase("C:\MYDB.MDB") The problem is that on the last line I am getting the error 'DBEngine' is a type and cannot be used as an expression. What am I doing wrong? Many Thanks Regards |
#5
|
|||
|
|||
Opening Access db via DAO in vb.net
"Michel Posseth [MCP]" wrote in message ... What am I doing wrong? snip 2 Is using DAO while it is already a long , long time ago declared obsolete even in the end of VB6 it was already declared as obsolete technollogy and ADO was prefered If you nowadays still use ACCESS in my opinion for new projects you should not ! but use one of the SQL engines closest to Access is the SQL CE engine , e.g. sql server everywhere then you should connect with ADO.Net. So having said this it is still possible to connect with DAO , however i will sure not recomend it to you snip DAO is still the recommended method for accessing data in Microsoft Access databases if you are using the Jet database engine. Its performance is significantly better than ADO in this scenario. Ed Metcalfe. |
#6
|
|||
|
|||
Opening Access db via DAO in vb.net
snip
DAO is still the recommended method for accessing data in Microsoft Access databases if you are using the Jet database engine. /snip Recomended by who ? as MS did not even bother to develop a 64 bit Jet oledb driver for Access this means that even ADO.Net can`t work with Access so in my opinion MS doesn`t want you to use Access at all in newly to develop products . that is probably also the reasson why in all study materials , examples etc etc only connections to one of the SQL family`s is shown ( wich by the way do have 64 bit equivalants ) snip Its performance is significantly better than ADO in this scenario. /snip DAO `s perfomance is superb on ACCESS , as it is a specialized engine optimized for this database However my question is should you use a long time ago fased out technology in a newly developed product ? as i said when i was programming in VB6 ADO was already declared Obsolete technology , so using it now in VB.Net is in my opinion foolish And if we are talking about perfomance lets put the cards right and compares against SQL server CE wich is the substitute for a Access database in ..Net Michel "Ed Metcalfe" schreef in bericht ... "Michel Posseth [MCP]" wrote in message ... What am I doing wrong? snip 2 Is using DAO while it is already a long , long time ago declared obsolete even in the end of VB6 it was already declared as obsolete technollogy and ADO was prefered If you nowadays still use ACCESS in my opinion for new projects you should not ! but use one of the SQL engines closest to Access is the SQL CE engine , e.g. sql server everywhere then you should connect with ADO.Net. So having said this it is still possible to connect with DAO , however i will sure not recomend it to you snip DAO is still the recommended method for accessing data in Microsoft Access databases if you are using the Jet database engine. Its performance is significantly better than ADO in this scenario. Ed Metcalfe. |
#7
|
|||
|
|||
Opening Access db via DAO in vb.net
http://msdn2.microsoft.com/en-us/library/ms810810.aspx scroll to the bottom to see that DAO is officially declared Obsolete ( a long time ago ) note: that this paper was released the first time in January 2002 but it was known to the programming comunity long time before that I am a person with a strong readers memory ( everything i once read stays in my mind ) so i just looked in my library i knew it was somewhere there Chapter 8 Databases page 393 and page 394 of the official Core reference guide of VB6 "Programming Microsoft Visual Basic 6.0". If you read these 2 pages you will see that DAO is already in the replacement phase in favor of ADO , the core VB6 book tells you between the lines that DAO is VB 5.0 and in VB6 projects you should favor the new ADO engine for the simple reasson that DAO is going to be replaced by ADO remember that this book is written in early 1999 !!! A funny thing i just encountered is that the writer of the book ( Balena ) tells you if you really need to use DAO or RDO buy the superb book "Hitchiker`s guide to Visual basic and SQL server by William R. Vaughn " Well "William R. Vaughn" is also known as "Bill Vaughn" active in these newsgroups and he is the person who convinced me that there is absolutely no reasson at all to stick using Access now we have SQL server CE If a person walked into my office and dare to propose a desktop app written in VS.Net 2008 with a ACCESS db backend wich uses DAO i would laugh an not take this person serious annymore , i doubt if this person is qualified to do his job right Michel "Michel Posseth [MCP]" schreef in bericht ... snip DAO is still the recommended method for accessing data in Microsoft Access databases if you are using the Jet database engine. /snip Recomended by who ? as MS did not even bother to develop a 64 bit Jet oledb driver for Access this means that even ADO.Net can`t work with Access so in my opinion MS doesn`t want you to use Access at all in newly to develop products . that is probably also the reasson why in all study materials , examples etc etc only connections to one of the SQL family`s is shown ( wich by the way do have 64 bit equivalants ) snip Its performance is significantly better than ADO in this scenario. /snip DAO `s perfomance is superb on ACCESS , as it is a specialized engine optimized for this database However my question is should you use a long time ago fased out technology in a newly developed product ? as i said when i was programming in VB6 ADO was already declared Obsolete technology , so using it now in VB.Net is in my opinion foolish And if we are talking about perfomance lets put the cards right and compares against SQL server CE wich is the substitute for a Access database in .Net Michel "Ed Metcalfe" schreef in bericht ... "Michel Posseth [MCP]" wrote in message ... What am I doing wrong? snip 2 Is using DAO while it is already a long , long time ago declared obsolete even in the end of VB6 it was already declared as obsolete technollogy and ADO was prefered If you nowadays still use ACCESS in my opinion for new projects you should not ! but use one of the SQL engines closest to Access is the SQL CE engine , e.g. sql server everywhere then you should connect with ADO.Net. So having said this it is still possible to connect with DAO , however i will sure not recomend it to you snip DAO is still the recommended method for accessing data in Microsoft Access databases if you are using the Jet database engine. Its performance is significantly better than ADO in this scenario. Ed Metcalfe. |
#8
|
|||
|
|||
Opening Access db via DAO in vb.net
Michael,
In my idea you should not put so much effort to tell that the world is round. :-) Cor "Michel Posseth [MCP]" schreef in bericht ... snip DAO is still the recommended method for accessing data in Microsoft Access databases if you are using the Jet database engine. /snip Recomended by who ? as MS did not even bother to develop a 64 bit Jet oledb driver for Access this means that even ADO.Net can`t work with Access so in my opinion MS doesn`t want you to use Access at all in newly to develop products . that is probably also the reasson why in all study materials , examples etc etc only connections to one of the SQL family`s is shown ( wich by the way do have 64 bit equivalants ) snip Its performance is significantly better than ADO in this scenario. /snip DAO `s perfomance is superb on ACCESS , as it is a specialized engine optimized for this database However my question is should you use a long time ago fased out technology in a newly developed product ? as i said when i was programming in VB6 ADO was already declared Obsolete technology , so using it now in VB.Net is in my opinion foolish And if we are talking about perfomance lets put the cards right and compares against SQL server CE wich is the substitute for a Access database in .Net Michel "Ed Metcalfe" schreef in bericht ... "Michel Posseth [MCP]" wrote in message ... What am I doing wrong? snip 2 Is using DAO while it is already a long , long time ago declared obsolete even in the end of VB6 it was already declared as obsolete technollogy and ADO was prefered If you nowadays still use ACCESS in my opinion for new projects you should not ! but use one of the SQL engines closest to Access is the SQL CE engine , e.g. sql server everywhere then you should connect with ADO.Net. So having said this it is still possible to connect with DAO , however i will sure not recomend it to you snip DAO is still the recommended method for accessing data in Microsoft Access databases if you are using the Jet database engine. Its performance is significantly better than ADO in this scenario. Ed Metcalfe. |
#9
|
|||
|
|||
Opening Access db via DAO in vb.net
Well Cor , I guess you are right , but on the othe hand if nobady would bother , it could become the standard that the world is flat :-) Michel "Cor Ligthert[MVP]" schreef in bericht ... Michael, In my idea you should not put so much effort to tell that the world is round. :-) Cor "Michel Posseth [MCP]" schreef in bericht ... snip DAO is still the recommended method for accessing data in Microsoft Access databases if you are using the Jet database engine. /snip Recomended by who ? as MS did not even bother to develop a 64 bit Jet oledb driver for Access this means that even ADO.Net can`t work with Access so in my opinion MS doesn`t want you to use Access at all in newly to develop products . that is probably also the reasson why in all study materials , examples etc etc only connections to one of the SQL family`s is shown ( wich by the way do have 64 bit equivalants ) snip Its performance is significantly better than ADO in this scenario. /snip DAO `s perfomance is superb on ACCESS , as it is a specialized engine optimized for this database However my question is should you use a long time ago fased out technology in a newly developed product ? as i said when i was programming in VB6 ADO was already declared Obsolete technology , so using it now in VB.Net is in my opinion foolish And if we are talking about perfomance lets put the cards right and compares against SQL server CE wich is the substitute for a Access database in .Net Michel "Ed Metcalfe" schreef in bericht ... "Michel Posseth [MCP]" wrote in message ... What am I doing wrong? snip 2 Is using DAO while it is already a long , long time ago declared obsolete even in the end of VB6 it was already declared as obsolete technollogy and ADO was prefered If you nowadays still use ACCESS in my opinion for new projects you should not ! but use one of the SQL engines closest to Access is the SQL CE engine , e.g. sql server everywhere then you should connect with ADO.Net. So having said this it is still possible to connect with DAO , however i will sure not recomend it to you snip DAO is still the recommended method for accessing data in Microsoft Access databases if you are using the Jet database engine. Its performance is significantly better than ADO in this scenario. Ed Metcalfe. |
#10
|
|||
|
|||
Opening Access db via DAO in vb.net
With all other replies being post, I am just wondering: why on the earth do
you need to use DAO in .NET? "John" wrote in message ... Hi In my vb.net app I am trying to open a db via DAO as below; Imports dao Dim dbSynch As dao.Database dbSynch = DBEngine(0).OpenDatabase("C:\MYDB.MDB") The problem is that on the last line I am getting the error 'DBEngine' is a type and cannot be used as an expression. What am I doing wrong? Many Thanks Regards |
Thread Tools | |
Display Modes | |
|
|