How to connect MS access with VB
Connecting MS access with VB
Collapse
X
-
Originally posted by prabakarHow to connect MS access with VB
Let me know how it turns out...Comment
-
well the code below gives a connection to the database
dim db as new ADODB.connectio n
set db =new ADODB.connectio n
db.open="PROVID ER=Microsoft.je t.OLeDB.3.51;Da ta Source=" & App.Path & "\xxx.mdb;" this is for an access database, pls give your tablename in the xxx
this makes a coinnection, however u need a Recordset to actually add,delete or edit records
for this
dim rs as new ADODB.recordset
set rs =new ADODB.recordset
rs.Open "SELECT * from tablename", db, adOpenDynamic, adLockOptimisti c
this makes a perfect connection and now with a more detailed program u can add and delete records.Comment
-
Actually this is regarding the previous post
First of all select Microsoft ADO Object library.from Project---Reference
Next(regaring previous post)
In place of xxx instead of using tablename please use DATABASE name.
rest all is fine
and to open the recordset use TABLENAME in the SQL statment.Comment
Comment