Yes, this is likely the problem... As I recall, I've run into this one
myself.
----- Original Message -----
From: "Kim, Cardyin" <CKim@s...>
To: "professional vb" <pro_vb@p...>
Sent: Thursday, September 26, 2002 5:03 PM
Subject: [pro_vb] RE: Error in SQL statement
> Mark, perhaps you have a name like O'Henry which already has a ' in it.
> If this is the case, you will get:
>
> SELECT Security FROM FROM OMP_Users WHERE UserName = 'O'Henry'
>
> You will have to do a check for this and send '' instead of one:
> O''Henry.
>
> Hope this helps.
>
> Cardyin
>
> ------------------------------------------
> Cardyin Kim
> C/S & Web Development Analyst
> San Antonio Community Hospital
> Upland, CA
> ckim@s... (xxx)xxx-xxxx
> ------------------------------------------
>
> -----Original Message-----
> From: Markham Deal [mailto:mark.deal@e...]
> Sent: Thursday, September 26, 2002 5:00 PM
> To: professional vb
> Subject: [pro_vb] Error in SQL statement
>
> Hello SQL experts,
>
> I am having a problem (probably something simple that I am missing) in a
> SQL statement for SQL Server 7. I keep getting an error that
> reads, "Unclosed quotation mark before the character
> string 'myusername'." The error occurs on the last line. When I hard
> code a user name I don't get an error. Any ideas?
>
> Thanks in advance,
>
> Mark
>
> *********************
> Public Function Get_UserAccessRights(strUserName As String) As String
> cnGMD_SQL.Open
> cnGMD_SQL.CursorLocation = adUseServer
>
> strSQL = "SELECT Security FROM OMP_Users WHERE UserName = '" &
> strUserName & "'"
> rsAddUser.LockType = adLockOptimistic
> rsAddUser.CursorType = adOpenKeyset
> rsAddUser.Open strSQL, cnGMD_SQL, , , adCmdText
>
> ---
> Visual C# - A Guide for VB6 Developers
> This book will make it easy to transfer your skills
> from Visual Basic 6 to C#, the language of choice
> of the .NET Framework.
> http://www.wrox.com/ACON11.asp?ISBN=1861007175&p2p0059
>
> to unsubscribe send a blank email to ..
>
>
> ---
> Visual C# - A Guide for VB6 Developers
> This book will make it easy to transfer your skills
> from Visual Basic 6 to C#, the language of choice
> of the .NET Framework.
> http://www.wrox.com/ACON11.asp?ISBN=1861007175&p2p0059
>