This code opens a table in an access database using a SQL statement.
This code opens a table in an access database using a SQL statement.
API Declarations
dim rs as new adodb.recordset
Rate This code opens a table in an access database using a SQL statement.
(1(1 Vote))
'assume that the table name is table1
'assume that the database is located in the folder
'where the application is located
'paste this code on the Form_Load event
cn.open "provider = Microsoft.Jet.OLEDB.4.0; Data Source =" & app.path & "\sample.mdb"
with rs
.activeconnection = cn
.cursortype = adopendynamic
.locktype = adlockoptimistic
.source = "select * from table1" 'this is to select all records from the table
.open
end with
This code opens a table in an access database using a SQL statement. Comments
No comments yet — be the first to post one!
Post a Comment