Wrox Programmer Forums
|
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 31st, 2006, 03:33 PM
Registered User
 
Join Date: Aug 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to koss77
Default Line Contiuation

This seem easy I can not make to work please help. How to break this into several line of code?

sqlString = "SELECT DISTINCTROW PHARM_INSURED_OFFLINE.ALTERNATE_ID, PHARM_INSURED_OFFLINE.LAST_NAME, PHARM_INSURED_OFFLINE.FIRST_NAME, PHARM_INSURED_OFFLINE.ADDRESS1, PHARM_INSURED_OFFLINE.ADDRESS2, PHARM_INSURED_OFFLINE.DIVISION, PHARM_INSURED_OFFLINE.LOCATION, PHARM_INSURED_ONLINE.GROUP_KEY, PHARM_INSURED_ONLINE.PERSON_CODE, PHARM_INSURED_ONLINE.EFFECTIVE_DATE, PHARM_INSURED_ONLINE.BIRTH_DATE, PHARM_INSURED_ONLINE.TERMINATION_DATE"


All this line are suppose to be a single line. But I want them in different line using underscore but it seem that I am not getting it right.

 
Old August 31st, 2006, 06:49 PM
Registered User
 
Join Date: Aug 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You need to insert an underscore at the end of each line to continue the lines and some &'s (or +'s, if you prefer to connect strings that way) to connect the strings, like this:

sqlString = "SELECT DISTINCTROW PHARM_INSURED_OFFLINE.ALTERNATE_ID," & _
    "PHARM_INSURED_OFFLINE.LAST_NAME, PHARM_INSURED_OFFLINE.FIRST_NAME," & _
    "PHARM_INSURED_OFFLINE.ADDRESS1, PHARM_INSURED_OFFLINE.ADDRESS2," & _
    "PHARM_INSURED_OFFLINE.DIVISION, PHARM_INSURED_OFFLINE.LOCATION," & _
    "PHARM_INSURED_ONLINE.GROUP_KEY, PHARM_INSURED_ONLINE.PERSON_CODE," & _
    "PHARM_INSURED_ONLINE.EFFECTIVE_DATE, PHARM_INSURED_ONLINE.BIRTH_DATE," & _
    "PHARM_INSURED_ONLINE.TERMINATION_DATE"

(Notice that there is a space between the & and the _. If you position the underscore up against the & at the end of each line, you'll get errors.)

Hope that solves your problem.





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to draw indicator line in owc line chart AlexOo General .NET 0 July 9th, 2007 10:32 PM
Reading a string from line by line vaidyapragati ASP.NET 2.0 Professional 1 May 3rd, 2007 08:43 AM
How to read file line by line in EVC++ iriskab Visual C++ 0 September 27th, 2006 01:39 PM
Reading line by line from a .txt file x_ray VB.NET 2002/2003 Basics 5 February 10th, 2006 01:55 PM
how can i take line by line in the richtextbox kamarajraj Beginning VB 6 0 August 12th, 2005 04:29 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.