reading tables in VB

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to access a table from VB so I get at the different records and
eventually write them out to a file in a format that i have designed. But
can't figure out how to get at the talbe.
 
dave said:
I need to access a table from VB so I get at the different records and
eventually write them out to a file in a format that i have designed. But
can't figure out how to get at the talbe.

Tools >> References >> Microsoft ADO Ext. 2.8 for DDL and Security >> Check
it

Dim rs1 As ADODB.Recordset
Set rs1 = New ADODB.Recordset

MyLocation = App.Path + "\BatchArchive\" + txtBatchID.Text + ".mdb"

rs1.Open "SELECT * FROM " & MyTable, "Provider='Microsoft.Jet.OLEDB.4.0';" &
"Data Source=" + MyLocation, adOpenStatic, adLockOptimistic

rs1.movefirst

Do Until rs1.EOF
This is the playground
rs1.MoveNext
Loop
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top