Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Dim con as ADODB.Connection
Dim rs as ADODB.Recordset
'construct data objects
set con = New ADODB.Connection
set rs = New ADODB.Recordset
'open the connection to the database
con.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\db1.mdb"
with rs
'populate the recordset
.Open "select field1 from table1", con
'check if empty
if not (.bof and eof) then
.MoveFirst
'output the contents
do until .eof
msgBox rs(0)
.MoveNext
loop
else
msgBox "db returned nothing"
end if
end with
rs.Close
set rs = Nothing
set con = Nothing
rs.Open "SELECT * FROM TableName", YourConnection
rs.Open "TableName", YourConnection
rs.Open "SELECT Field1, Field2 FROM TableName WHERE Field1 = 'Something'", YourConnection
rs.Open "YourSavedQueryName", YourConnection
ProdRec.Open "SELECT * FROM Product", Cnct, adOpenKeyset, adLockReadOnly
if Not (ProdRec.BOF And ProdRec.EOF) then
ProdRec.MoveFirst
While Not ProdRec.EOF
form1.lstResults.AddItem ProdRec("EAN 8/13") & vbTab & ProdRec("Title")
ProdRec.MoveNext
Wend
else
msgBox "Empty recordset"
end if
ProdRec.Close