Solved

Help with Error: Too Many Line Continuations

Posted on 2004-03-28
2
550 Views
Last Modified: 2013-12-25
Using VS6 SP5 on Windows 2000 Box connecting to an Access2K DB.

Below is the code I am using on a new form, I have about 25 more possible updates that I need to occur however
each time I try to add a new one I get the error mentioned in the Subject. Is there another way to do this ??

strSQL = "UPDATE projecttrack SET " & _
    "ProjectDepartment = '" & Trim(Text54.Text) & "', " & _
    "EquipmentRequested = '" & Trim(Check1.Value) & "', " & _
    "ManagerRequesting = '" & Trim(Text45.Text) & "', " & _
    "ManagerContactNumber = '" & Trim(Text7.Text) & "', " & _
    "EquipmentDescription = '" & Trim(Text8.Text) & "', " & _
    "VendorInvolved = '" & Trim(Check2.Value) & "', " & _
    "ContactPerson = '" & Trim(Text4.Text) & "', " & _
    "ContactNumber = '" & Trim(Text12.Text) & "', " & _
    "VendorName = '" & Trim(Text5.Text) & "', " & _
    "AlternateNumber = '" & Trim(Text9.Text) & "', " & _
    "MiscInfo= '" & Replace(Trim(Text10.Text), "'", "`") & "', " & _
    "ProjAssignedTo = '" & Trim(Combo2.Text) & "', " & _
    "ProjectStatus = '" & Trim(Combo3.Text) & "', " & _
    "DateCompleted = '" & Trim(Text46.Text) & "', " & _
    "ProjectPO = '" & Trim(Text33.Text) & "', " & _
    "SPRID = '" & Trim(Text42.Text) & "', " & _
    "InstructionsCreated = '" & Trim(Check5.Value) & "', " & _
    "DocumentationCreated = '" & Trim(Check6.Value) & "', " & _
    "VendorInvolved = '" & Trim(Check3.Value) & "', " & _
    "VendorName = '" & Trim(Text43.Text) & "', " & _
    "ContactNumber = '" & Trim(Text44.Text) & "', " & _
    "VendorRasAccountName = '" & Trim(Text47.Text) & "', " & _
    "VendorRasPassword = '" & Trim(Text53.Text) & "', " &        <<<  When I try to place "_" is when I get the error....
    "HardwareDescription = '" & Trim(Text16.Text) & "' " & _
    "WHERE EventId = " & Text48
 cnConn.Execute strSQL

Thanks, Alot..

Just3082
0
Comment
Question by:just3082
2 Comments
 
LVL 69

Accepted Solution

by:
Éric Moreau earned 250 total points
ID: 10699517
You need to cut your line in 2 or more parts like this:

strSQL = "UPDATE projecttrack SET " & _
    "ProjectDepartment = '" & Trim(Text54.Text) & "', " & _
    "EquipmentRequested = '" & Trim(Check1.Value) & "', " & _
    "ManagerRequesting = '" & Trim(Text45.Text) & "', " & _
    "ManagerContactNumber = '" & Trim(Text7.Text) & "', " & _
    "EquipmentDescription = '" & Trim(Text8.Text) & "', " & _
    "VendorInvolved = '" & Trim(Check2.Value) & "', " & _
    "ContactPerson = '" & Trim(Text4.Text) & "', " & _
    "ContactNumber = '" & Trim(Text12.Text) & "', " & _
    "VendorName = '" & Trim(Text5.Text) & "', " & _
    "AlternateNumber = '" & Trim(Text9.Text) & "', " & _
    "MiscInfo= '" & Replace(Trim(Text10.Text), "'", "`") & "', " & _
    "ProjAssignedTo = '" & Trim(Combo2.Text) & "', " & _
    "ProjectStatus = '" & Trim(Combo3.Text) & "', " & _
    "DateCompleted = '" & Trim(Text46.Text) & "', " & _
    "ProjectPO = '" & Trim(Text33.Text) & "', " & _
    "SPRID = '" & Trim(Text42.Text) & "', " & _
    "InstructionsCreated = '" & Trim(Check5.Value) & "', " & _
    "DocumentationCreated = '" & Trim(Check6.Value) & "', " & _
    "VendorInvolved = '" & Trim(Check3.Value) & "', " & _
    "VendorName = '" & Trim(Text43.Text) & "', " & _
    "ContactNumber = '" & Trim(Text44.Text) & "', " & _
    "VendorRasAccountName = '" & Trim(Text47.Text) & "', "

strsql = strsql & _
    "VendorRasPassword = '" & Trim(Text53.Text) & "', " & _
    "HardwareDescription = '" & Trim(Text16.Text) & "' " & _
    "WHERE EventId = " & Text48
0
 
LVL 44

Expert Comment

by:Arthur_Wood
ID: 10699752
you can also do it this way:

strSQL = "UPDATE projecttrack SET "
strSQL = strSQL &    "ProjectDepartment = '" & Trim(Text54.Text) & "', "
strSQL = strSQL &    "EquipmentRequested = '" & Trim(Check1.Value) & "', "
strSQL = strSQL &    "ManagerRequesting = '" & Trim(Text45.Text) & "', "
strSQL = strSQL &    "ManagerContactNumber = '" & Trim(Text7.Text) & "', "
strSQL = strSQL &    "EquipmentDescription = '" & Trim(Text8.Text) & "', "
strSQL = strSQL &    "VendorInvolved = '" & Trim(Check2.Value) & "', "
strSQL = strSQL &    "ContactPerson = '" & Trim(Text4.Text) & "', "
strSQL = strSQL &    "ContactNumber = '" & Trim(Text12.Text) & "', "
strSQL = strSQL &    "VendorName = '" & Trim(Text5.Text) & "', "
strSQL = strSQL &    "AlternateNumber = '" & Trim(Text9.Text) & "', "
strSQL = strSQL &    "MiscInfo= '" & Replace(Trim(Text10.Text), "'", "`") & "', "
strSQL = strSQL &    "ProjAssignedTo = '" & Trim(Combo2.Text) & "', "
strSQL = strSQL &    "ProjectStatus = '" & Trim(Combo3.Text) & "', "
strSQL = strSQL &    "DateCompleted = '" & Trim(Text46.Text) & "', "
strSQL = strSQL &    "ProjectPO = '" & Trim(Text33.Text) & "', "
strSQL = strSQL &    "SPRID = '" & Trim(Text42.Text) & "', "
strSQL = strSQL &    "InstructionsCreated = '" & Trim(Check5.Value) & "', "
strSQL = strSQL &    "DocumentationCreated = '" & Trim(Check6.Value) & "', "
strSQL = strSQL &    "VendorInvolved = '" & Trim(Check3.Value) & "', "
strSQL = strSQL &    "VendorName = '" & Trim(Text43.Text) & "', "
strSQL = strSQL &    "ContactNumber = '" & Trim(Text44.Text) & "', "
strSQL = strSQL &    "VendorRasAccountName = '" & Trim(Text47.Text) & "', "
strSQL = strSQL &    "VendorRasPassword = '" & Trim(Text53.Text) & "', "
strSQL = strSQL &    "HardwareDescription = '" & Trim(Text16.Text) & "' "
strSQL = strSQL &    "WHERE EventId = " & Text48

AW
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now