Solved

Help with Error: Too Many Line Continuations

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…
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…

911 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

20 Experts available now in Live!

Get 1:1 Help Now