Solved

Help with Error: Too Many Line Continuations

Posted on 2004-03-28
2
554 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 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

730 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