by Glenilo Geraldizo (2 Submissions)
Category: Databases/Data Access/DAO/ADO
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Wed 2nd February 2005
Date Added: Mon 8th February 2021
Rating: (1 Votes)
This code opens a table in an access database using a SQL statement.
API Declarations
dim rs as new adodb.recordset
'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
No comments have been posted about This code opens a table in an access database using a SQL statement.. Why not be the first to post a comment about This code opens a table in an access database using a SQL statement..