VB 6 to VB.Net syntax...
-
I am working with VB.Net 2005 and I am re-writing a small program that was in VB6 format. I currently have a Dataset looking at my Access database. In the old code it used these statements to look at the database. Public dbComp As DAO.Database Dim qdf As DAO.QueryDef Dim tdf As DAO.TableDef The routine that I am working with looks at the database (dbComp) and it deletes quries and creates them and then populates them. I am hoping that I can use my existing Dataset that I created instead of using these DAO connections. Can anyone help me out with this? I just need to know what I can use in .Net in place of those commands above. Thank you in advance for any help you can provide!
-
I am working with VB.Net 2005 and I am re-writing a small program that was in VB6 format. I currently have a Dataset looking at my Access database. In the old code it used these statements to look at the database. Public dbComp As DAO.Database Dim qdf As DAO.QueryDef Dim tdf As DAO.TableDef The routine that I am working with looks at the database (dbComp) and it deletes quries and creates them and then populates them. I am hoping that I can use my existing Dataset that I created instead of using these DAO connections. Can anyone help me out with this? I just need to know what I can use in .Net in place of those commands above. Thank you in advance for any help you can provide!
You can certainly use ADO.Net and OLEDB via DataSets and DataViews to retrieve, update, insert or delete records in an Access database from .Net. However, you can not use ADO.Net to create an Access database, or any of the objects (tables, queries, etc.) in an Access database. One way to create an Access database and table objects from .Net would be to first create references to, and corresponding InterOps for, Microsoft ActiveX Data Objects. I imagine that a google will turn up lots of examples on creating Access databases and tables from .Net after making the proper references to ActiveX Data Objects. Good luck with your project.
-
You can certainly use ADO.Net and OLEDB via DataSets and DataViews to retrieve, update, insert or delete records in an Access database from .Net. However, you can not use ADO.Net to create an Access database, or any of the objects (tables, queries, etc.) in an Access database. One way to create an Access database and table objects from .Net would be to first create references to, and corresponding InterOps for, Microsoft ActiveX Data Objects. I imagine that a google will turn up lots of examples on creating Access databases and tables from .Net after making the proper references to ActiveX Data Objects. Good luck with your project.
Another way to create an Access database without all of that hassle: If you know the basic structure of the Access Database, then you create the basic 'template' in Access and then embed the database into your application. Then through the use of File.IO and Reflection you can stream the template to a local file for alteration. (It is simpler than it may sound).
Regards, Thomas Stockwell Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. Visit my Blog