Solved

The multi-part identifier could not be bound??

Posted on 2011-02-18
5
617 Views
Last Modified: 2012-05-11
I am getting this error when running this update query. Can someone help me to figure out why?

ERROR: The multi-part identifier could not be bound.

Session("FileName") = File.FileName
                              
'test = (Session("FileName"))   NOT WORK
'test = "FileName.txt"   NOT WORK
test = 3   WORKS


Thanks

 Table
Session("FileName") = File.FileName
					
					'test = (Session("FileName"))
					'test = "FileName.txt"
					test = 3
					
					sSQL = "update RegWorkDetail set IsItemComplete = 1, UpFName = " & test & " where SGID = " & Session("strSGID") & " and RWID = " & Request.QueryString("RWID")
					oConn.Execute(sSQL)

Open in new window

0
Comment
Question by:Ahelbling
  • 2
  • 2
5 Comments
 
LVL 15

Accepted Solution

by:
derekkromm earned 500 total points
ID: 34928631
you need to put quotes around strings in the sql

so ...UpFName = '" & test & "' where
0
 

Author Comment

by:Ahelbling
ID: 34928651
Thanks!
0
 
LVL 51

Expert Comment

by:HainKurt
ID: 34928667
sSQL = "update RegWorkDetail set IsItemComplete = 1, UpFName = " & test & " where SGID = " & Session("strSGID") & " and RWID = " & Request.QueryString("RWID")
-->
sSQL = "update RegWorkDetail set IsItemComplete = 1, UpFName = '" & test & "' where SGID = '" & Session("strSGID") & "' and RWID = '" & Request.QueryString("RWID") & "'"

assuming Request.QueryString("RWID") & Session("strSGID") are also strings...
0
 
LVL 15

Expert Comment

by:derekkromm
ID: 34928709
Also, something to keep in mind is that if the string contains a ' it'll cause issues. So in general, you'll want to replace any ' with '' prior to concatenating the string.
0
 

Author Comment

by:Ahelbling
ID: 34928854
Got it = thanks
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Let's review the features of new SQL Server 2012 (Denali CTP3). It listed as below: PERCENT_RANK(): PERCENT_RANK() function will returns the percentage value of rank of the values among its group. PERCENT_RANK() function value always in be…
Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Viewers will learn how the fundamental information of how to create a table.

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