?
Solved

Help with Error: Too Many Line Continuations

Posted on 2004-03-28
2
Medium Priority
?
556 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 1000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

800 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