Solved

Update statement

Posted on 2006-11-08
7
176 Views
Last Modified: 2010-04-23
What am I missing please I Keep getting an error that I have unclosed quotation marks.  Thanks

    Dim cmd6 As New SqlClient.SqlCommand("update tblPAScreen set dtmdate = '" & txtdtmtoday.Text & "',lngstaffid = '" & PAStaffid & "',strActionTaken = '" & ComboBox2.Text & "',strfname = '" & txtstrpfname.Text & "', strlname = '" & txtstrplname.Text & "',strcfname = '" & txtstrfname.Text & "',strclname = '" & txtstrlname.Text & "',dtmdob = '" & txtdob.Text & "',strhphone = '" & txtstrphone.CtlText & "',strwphone = '" & txtstrmessage.CtlText & "',straddress = '" & txtaddress.Text & "',strcity = '" & txtcity.Text & "',strstate = '" & txtstate.Text & "',strzip = '" & txtzip.Text & "',strmaddress = '" & txtmaddress.Text & "',strmcity = '" & txtmcity.Text & "',strmstate = '" & txtmstate.Text & "',strmzip = '" & txtmzip.Text & "',ysnRXInsurance = '" & rxins & "',ysnVeteran = '" & veteran & "',ysnMedicare = '" & medicare & "',strreferredby = '" & txtstrreferby.Text & "',strPrescribingdr = '" & txtstrDoctorRX.Text & "',inthhsize = '" & txtinthousehold.Text & "',strPharmacy = '" & TextBox3.Text & "',dtmappt = '" & txtdtmappointment.Text & "',dtmappttime = '" & txtdtmappttime.Text & "',lngadvocate = '" & PAAdvocateid & "',strnotes = '" & TextBox1.Text & "',lngassets = " & TextBox17.Text & "',lngpatientid = '" & txtid.Text & "', lngstatus = '" & status & "' where lngScreenid = '" & screenid & "'", Connection1)
   
0
Comment
Question by:running32
7 Comments
 
LVL 10

Expert Comment

by:Kinger247
ID: 17898846
missing single quote in (lngassets = ) !
0
 
LVL 10

Accepted Solution

by:
Kinger247 earned 500 total points
ID: 17898853
Should be this :

        Dim cmd6 As New SqlClient.SqlCommand("update tblPAScreen set dtmdate = '" & txtdtmtoday.Text & "',lngstaffid = '" & PAStaffid & "',strActionTaken = '" & ComboBox2.Text & "',strfname = '" & txtstrpfname.Text & "', strlname = '" & txtstrplname.Text & "',strcfname = '" & txtstrfname.Text & "',strclname = '" & txtstrlname.Text & "',dtmdob = '" & txtdob.Text & "',strhphone = '" & txtstrphone.CtlText & "',strwphone = '" & txtstrmessage.CtlText & "',straddress = '" & txtaddress.Text & "',strcity = '" & txtcity.Text & "',strstate = '" & txtstate.Text & "',strzip = '" & txtzip.Text & "',strmaddress = '" & txtmaddress.Text & "',strmcity = '" & txtmcity.Text & "',strmstate = '" & txtmstate.Text & "',strmzip = '" & txtmzip.Text & "',ysnRXInsurance = '" & rxins & "',ysnVeteran = '" & veteran & "',ysnMedicare = '" & medicare & "',strreferredby = '" & txtstrreferby.Text & "',strPrescribingdr = '" & txtstrDoctorRX.Text & "',inthhsize = '" & txtinthousehold.Text & "',strPharmacy = '" & TextBox3.Text & "',dtmappt = '" & txtdtmappointment.Text & "',dtmappttime = '" & txtdtmappttime.Text & "',lngadvocate = '" & PAAdvocateid & "',strnotes = '" & TextBox1.Text & "',lngassets = '" & TextBox17.Text & "',lngpatientid = '" & txtid.Text & "', lngstatus = '" & status & "' where lngScreenid = '" & screenid & "'", Connection1)
0
 
LVL 12

Expert Comment

by:Mamtha1982
ID: 17898869
what is this =>   txtstrmessage.CtlText ???

here no quotation:
ngassets = " & TextBox17.Text & "'  
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 13

Expert Comment

by:newyuppie
ID: 17898903
my, FAST READERS! its impossible to keep up...
0
 

Author Comment

by:running32
ID: 17898911

Opps, great thanks
0
 
LVL 10

Expert Comment

by:Kinger247
ID: 17898918
I'm on my 7th coffee ny ! ...
getting a bit jittery though now ;)
0
 
LVL 12

Expert Comment

by:Mamtha1982
ID: 17898927
Just for you future refference runnung32,
next time try to use String.Format function, very easy to debug.

Ex:
Dim Update As String
Update= String.Format("update tblPAScreen set dtmdate = '{0}', lngstaffid = '{1}, ................ ",  txtdtmtoday.Text,
PAStaffid, ..............)
0

Featured Post

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

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

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…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

821 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