Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / March 2008

Tip: Looking for answers? Try searching our database.

SQL query

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Rolf G - 27 Mar 2008 22:05 GMT
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
MarkS - 27 Mar 2008 23:23 GMT
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

> Hi
> I try to use this qurey
[quoted text clipped - 13 lines]
>
> *** Sent via Developersdex http://www.developersdex.com ***
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.