473,800 Members | 2,722 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

probs using line continuation characters

MLH
I don't understand why (a) works and compiles but (b) does not...

(a)
Set qdfTemp = .CreateQueryDef ("", _
"SELECT * FROM Employees")

(b)
Set qdfTemp = .CreateQueryDef ("", _
"SELECT DISTINCTROW tblPmtsRcd.PmtI D,
tblPmtsRcd.Invo iceNumber, tblPmtsRcd.Vehi cleJobID,
tblPmtsRcd.PmtR ecTDStamp _
FROM tblPmtsRcd LEFT JOIN tblinvoiceData ON
tblPmtsRcd.Invo iceNumber = tblinvoiceData. InvoiceNumber _
WHERE tblPmtsRcd.Invo iceNumber<>0 And tblPmtsRcd.Invo iceNumber
Is Not Null AND tblinvoiceData. InvoiceNumber Is Null")
' Open Recordset and print report.
GetrstTemp qdfTemp

Isn't (b) just a longer SQL string with continuation characters and
(a) a shorter SQL string with continuation characters?

Everytime I type the Set statement in (b) into a module, it turns
red and gives me an error. I do not recognize what is wrong.
With the damned newsreader wrapping - you may not be able
to see what I'm doing wrong either. Sorry about that. Would
like to know. If I type EVERYTHING on one line - no problem.
But when I try using line continuation characters everything
turns red.
Jun 27 '08 #1
3 4447
On Thu, 01 May 2008 19:10:57 -0400, MLH <CR**@NorthStat e.netwrote:
>I don't understand why (a) works and compiles but (b) does not...

(a)
Set qdfTemp = .CreateQueryDef ("", _
"SELECT * FROM Employees")

(b)
Set qdfTemp = .CreateQueryDef ("", _
"SELECT DISTINCTROW tblPmtsRcd.PmtI D,
tblPmtsRcd.Inv oiceNumber, tblPmtsRcd.Vehi cleJobID,
tblPmtsRcd.Pmt RecTDStamp _
FROM tblPmtsRcd LEFT JOIN tblinvoiceData ON
tblPmtsRcd.Inv oiceNumber = tblinvoiceData. InvoiceNumber _
WHERE tblPmtsRcd.Invo iceNumber<>0 And tblPmtsRcd.Invo iceNumber
Is Not Null AND tblinvoiceData. InvoiceNumber Is Null")
' Open Recordset and print report.
GetrstTemp qdfTemp

Isn't (b) just a longer SQL string with continuation characters and
(a) a shorter SQL string with continuation characters?

Everytime I type the Set statement in (b) into a module, it turns
red and gives me an error. I do not recognize what is wrong.
With the damned newsreader wrapping - you may not be able
to see what I'm doing wrong either. Sorry about that. Would
like to know. If I type EVERYTHING on one line - no problem.
But when I try using line continuation characters everything
turns red.
In b, you have the continuation character in the middle of a literal
string (" on both ends), but not in a.

If you need to continue a literal string there are a couple of options

SQL = "First part of the string " & _
"continuati on of string " & _
"last line of string"

SQL = "First part of the string " _
& "continuati on of string " _
& "last line of string"

Jun 27 '08 #2
MLH
Are you sure I'm in the middle of a literal string?
I don't think that's the case.

>
In b, you have the continuation character in the middle of a literal
string (" on both ends), but not in a.

If you need to continue a literal string there are a couple of options

SQL = "First part of the string " & _
"continuati on of string " & _
"last line of string"

SQL = "First part of the string " _
& "continuati on of string " _
& "last line of string"
Jun 27 '08 #3
MLH
Oops. My bad. Sorry... now I see it.
Jun 27 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

145
6398
by: David MacQuigg | last post by:
Playing with Prothon today, I am fascinated by the idea of eliminating classes in Python. I'm trying to figure out what fundamental benefit there is to having classes. Is all this complexity unecessary? Here is an example of a Python class with all three types of methods (instance, static, and class methods). # Example from Ch.23, p.381-2 of Learning Python, 2nd ed. class Multi:
11
1618
by: Russell Wallace | last post by:
Hi all, Python lets you continue a single logical line across more than one physical line, either by putting a \ at the end or letting it happen automatically with an incomplete infix operator. I'm wondering how often is this feature needed? Would there be any problems if it weren't part of the language? --
5
1572
by: Sandra-24 | last post by:
I'm not sure how complex this is, I've been brainstorming a little, and I've come up with: If the previous line ended with a comma or a \ (before an optional comment) That's easy to cover with a regex But that doesn't cover everything, because this is legal:
11
4773
by: prats | last post by:
I want to write a GUI application in PYTHON using QT. This application is supposed to take in Japanese characters. I am using PyQt as the wrapper for using QT from python. I am able to take input in japanese. But I am unable to display them back to GUI. It displays some junk characters Can anyone suggest me some way how to debug the issue. The code used for tranferring data from view to document is: " codec =...
13
14675
by: Don | last post by:
Hi, I have an SQL string that I'm trying to code into VBA and it's giving me trouble. I tried to use line continuation and concatenation as best I can to make it work. However, I'm stuck. I know that there are limitations to the length of the string but I can't break it up properly. I'm also thinking that I need to use multiples occurrences of strsql to do so but I'm not sure how. Can someone please tell me how to break this string up?
4
2336
by: Lawrence D'Oliveiro | last post by:
The Python docs recommend the use of triple-quoted string literals for docstrings, e.g. def Meet(Alice, Bob) : """arranges a meeting between Alice and Bob. Returns a reference to the meeting booking object.""" ... #end Meet However, these tend to get messed up by indentation whitespace, which gets
3
3434
by: psbasha | last post by:
Hi , I am following backslash ('\') as continuation of line as per the coding guidelines.Is there any other character to be used as continuation of line? Thanks in advance PSB
4
14283
by: Phoe6 | last post by:
Hi, I have a configfile, in fact, I am providing a configfile in the format: Name: Foo Author: Bar Testcases: tct123
6
1982
by: Russ P. | last post by:
I've always appreciated Python's lack of requirement for a semi-colon at the end of each line. I also appreciate its rules for automatic line continuation. If a statement ends with a "+", for example, Python recognizes that the statement obviously must continue. I've noticed, however, that the same rule does not apply when a line ends with "and," "or," or "not." Yes, it's a minor point, but shouldn't the same rule apply? Seems like it...
0
10507
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10279
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10036
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9092
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6815
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5607
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4150
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3765
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2948
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.