please how can i create a database and link it to my VB6 application. i designed a VB application to hold bio-data that will be updated from time to time but am finding it difficult to create the access back-end for it. please any urgent help will be most welcomed.

Recommended Answers

All 5 Replies

I am sorry friend, for it seems you have posted in VB.NET.

As for connections, you can find a good reference HERE

I will flag your post for the moderators to move to the correct section so that you will receive the correct help.

Thanks

There a few ways of using MS-Access databases with VB6, depending on whether you want to always use the same database or you want to choose which database at run-time. If you are always connecting to the same database, create a new Database project and connect to the database you created using MS-Access (Jet engine only). This will be the easiest way because you get all sorts of GUI help from the IDE.

If you want to decide which database you want to use at run-time, you can use DAO or ADO. DAO (Data Access Objects) is easier to use when directly connecting with an Access database. You can work with tables and queries in the database, but you can not use anything else, like forms and reports, that might be stored in the database as well. ADO (Advanced Data Objects) is better if you are using another type of database or going through ODBC.

Include a reference to DAO in your project. Create a module and put a Database object there; this way, all your VB6 forms can use the Database.

Public dbsProject AS Database

Also, it can be a good idea to create a Sub Main in this module which sets this to nothing.

Public Sub Main
    Set dbsProject = Nothing
    frmMain.Show vbModeless, Me
End Sub

Once you link in the DAO library, there is lots of information available in the help system. To add tables to your database, starting looking at CreateTableDef. To use the tables, look at OpenRecordset. For working with queries, look at CreateQueryDef. This can get you started working with DAO.

please how can i create a database and link it to my VB6 application. i designed a VB application to hold bio-data that will be updated from time to time but am finding it difficult to create the access back-end for it. please any urgent help will be most welcomed

This is less information about what makes you hard to code it?
How far you doing this? Post your code and we'll trying to help it.
You can use ADODB to linked vb6 with access.

try learning the basic of adodb;
Learn how to connect a database using ADODB.Connection
Learn CRUD (Create, Read, Update, Delete) using ADODB.Recordset

What have you done on your project so far?..

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.