ADO syntax problem

×

×לי

Hi!

I am using the following code to query access table. the code works fine. My
problem is how to name the field name ([Cell]) as a string, in order to use
this query as a dynamic query. I tried many things but nothing succeeded.

Thanks for your help!

Dim cnn As New ADODB.Connection
Dim rst As New ADODB.Recordset
cnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=C:\Documents and
Settings\Eli\My Documents\ETV_Cells.mdb"
rst.Open "SELECT * FROM CellTable ;", cnn, adOpenStatic
rst.MoveFirst
strCellCode = rst![Cell]

rst.Close
cnn.Close
Set rst = Nothing
Set cnn = Nothing


Eli
 

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

Top