Friday, November 19, 2010

How can I connect to an access database from an application that has been designed by VB?

Hi,

Goto Main menu

Project-%26gt;References

Then Check

Microsoft ActiveX Data Objects 2.0 Library

Press OK



Now declare a connection variable

dim conn as New connection,rs as new recordset



conn.Open ';Provider=Microsoft.Jet.OLEDB.4.0;Data Source=path\databaseName.mdb';

Now connection is established.



rs.open ';TableName';,conn,,

Recordset is open

No comments:

Post a Comment