Solved

Update statement

Posted on 2006-11-08
7
173 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
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…

744 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

12 Experts available now in Live!

Get 1:1 Help Now