#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default SQL query



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



*** Sent via Developersdex http://www.developersdex.com ***
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 49
Default SQL query

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

"Rolf G" wrote:



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



*** Sent via Developersdex http://www.developersdex.com ***

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Use MS Query to query data within the current work book Steve Kesler Excel Discussion (Misc queries) 0 August 6th 09 05:22 PM
Convert hard coded query criteria to Parameter Query Melanie[_2_] Excel Discussion (Misc queries) 0 July 15th 08 09:59 PM
Excel 2007 / MS Query - editing existing query to another sheet Hotpepperz Excel Discussion (Misc queries) 0 June 13th 08 06:53 PM
Web query: Want to pause macro while Web query completes refreshin Ellis Excel Programming 4 August 6th 07 04:04 AM
Anyone Else Use Database Query to Query Another Sheet in the Same Excel Workbook? jocke Excel Discussion (Misc queries) 1 November 29th 05 01:44 PM


All times are GMT +1. The time now is 11:53 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"