If you wish. But why let a sub-optimal coding practice restrict flexible naming of database fields and tables? (And that's assuming you even have control over the database naming.)
:-) noted. Dave S ----- Original Message ----- From: Adrian Forbes - ITD To: [email protected] Sent: Friday, March 18, 2005 8:57 PM Subject: RE: [ASP] Arrgghhh...quotes again! The alternative is to not use fieldnames that are keywords and not uses spaces in them either :) -----Original Message----- From: David Smart [mailto:[EMAIL PROTECTED] Sent: 18 March 2005 9:39 To: [email protected] Subject: Re: [ASP] Arrgghhh...quotes again! Square brackets. Actually, you should be using them around every field name, whether it has spaces or not. It's a good habit to get into. As well as spaces, it'll protect you against problems where field names are the same as keywords. > gstrSQLQuery = "SELECT * FROM [tbl_client] WHERE [Client Last Name] = > '" & strLName & "'" Dave S ----- Original Message ----- From: "Dian D. Chapman" <[EMAIL PROTECTED]> To: "Group - ASP" <[email protected]> Sent: Friday, March 18, 2005 6:08 PM Subject: [ASP] Arrgghhh...quotes again! > > Would someone please be so kind to tell me how to handle a field name > with spaces!<sigh> > > I'm trying to connect to a client's DB and they used spaces in their > field names. I've tried a dozen combinations and I keep getting a > syntax error. > > gstrSQLQuery = "SELECT * FROM tbl_client WHERE Client Last Name = '" & > strLName & "'" > > I end up with > > Run-time error '-2147217900 (80040e14)': > > Syntax error (missing operator) in query expression 'Client Last > Name = 'chapman''. > > I've tried quotes all over the place and can't get the @#$%^! thing > right. > > TIA... > Dian ~ > --------------------------------------------------------------------- Home : http://groups.yahoo.com/group/active-server-pages --------------------------------------------------------------------- Post : [email protected] Subscribe : [EMAIL PROTECTED] Unsubscribe: [EMAIL PROTECTED] --------------------------------------------------------------------- Yahoo! Groups Links The contents of this email and any attachments are sent for the personal attention of the addressee(s) only and may be confidential. If you are not the intended addressee, any use, disclosure or copying of this email and any attachments is unauthorised - please notify the sender by return and delete the message. Any representations or commitments expressed in this email are subject to contract. ntl Group Limited --------------------------------------------------------------------- Home : http://groups.yahoo.com/group/active-server-pages --------------------------------------------------------------------- Post : [email protected] Subscribe : [EMAIL PROTECTED] Unsubscribe: [EMAIL PROTECTED] --------------------------------------------------------------------- Yahoo! Groups Sponsor ADVERTISEMENT ------------------------------------------------------------------------------ Yahoo! Groups Links a.. To visit your group on the web, go to: http://groups.yahoo.com/group/active-server-pages/ b.. To unsubscribe from this group, send an email to: [EMAIL PROTECTED] c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. [Non-text portions of this message have been removed] --------------------------------------------------------------------- Home : http://groups.yahoo.com/group/active-server-pages --------------------------------------------------------------------- Post : [email protected] Subscribe : [EMAIL PROTECTED] Unsubscribe: [EMAIL PROTECTED] --------------------------------------------------------------------- Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/active-server-pages/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
