SQL query

  • Thread starter Thread starter Rolf G
  • Start date Start date
R

Rolf G

Hi
I try to use this qurey
szSQL = "SELECT * FROM [Blad1$] WHERE A = 1"

and it works fine if I don't use "WHERE A = 1"

Another question is how to do if I want to do somthing like this

SELECT A FROM [Blad1$]

Is it possible?

Sorry for my bad english

Ragards Rolf
 
Hi,
The query will work so long as the syntax is correct. You will need to put a
on error
clause in to trap the error you will get if it returns zero records. I use
this

On Error GoTo ErrorChecker:

ErrorChecker:
' EOF Error
If Err = 3021 Then
rsADO.Close
** Do Something **
End If
Else
MsgBox (Err & "Error")
Stop
End If
 

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