Solved

"constant expression is required" error when concatenating sting

Posted on 2006-06-12
1
204 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 500 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

Independent Software Vendors: 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

Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

719 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