Solved

"constant expression is required" error when concatenating sting

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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
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…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

757 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

22 Experts available now in Live!

Get 1:1 Help Now