?
Solved

"constant expression is required" error when concatenating sting

Posted on 2006-06-12
1
Medium Priority
?
205 Views
Last Modified: 2011-09-20
 when i try to run this code i'm getting an error:

Dim theUser = "foo"
Dim theEvent = "foo"
   
'Specify the SQL query
            Const sql As String = "UPDATE event_claims SET deleted = 0 WHERE userID = " & g & " AND eventID = " & theEvent


when does it expect these variables to the be constants?   this was certainly not hte case in 1.1.  what's up with this?
0
Comment
Question by:alisman
[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
1 Comment
 
LVL 10

Accepted Solution

by:
vadim63 earned 2000 total points
ID: 16890689
You can't use a constant and assign it the value of a non constant expression. Change it to

Dim sql As String = "UPDATE event_claims SET deleted = 0 WHERE userID = " & g & " AND eventID = " & theEvent
0

Featured Post

Technology Partners: 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

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

752 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