80040e14 Unclosed quotation mark

80040e14 Unclosed quotation mark

am 16.12.2005 02:17:25 von Phil Kelly

Hi

The following error is generated when I run the code underneath. I am trying
to write a guid from a session variable to a SQL table.

I cant't see an 'unclosed quotation mark anywhere! Any ideas?

Thanks!

Phil

ERROR:
Microsoft OLE DB Provider for SQL Server error '80040e14'
Unclosed quotation mark before the character string
'{536696D8-3928-40C2-9088-05032E705077}'.

CODE:
accountguid = server.createobject ("scriptlet.typelib").guid
<%Session("AccountGUID") = accountguid%>
Account GUID = <% = Session("AccountGUID") %><%
CreateAccount = "INSERT into tbl_test(fld_accountGUID, fld_firstname) VALUES
('"&accountguid&"', '"& Request.Form("fld_firstname") &"')"

Re: 80040e14 Unclosed quotation mark

am 16.12.2005 03:08:26 von Bob Lehmann

What do you see when you response.write(CreateAccount)?

that would be much more useful than the code you posted.

Or, try this....
CreateAccount = "INSERT into tbl_test(fld_accountGUID, fld_firstname) VALUES
('" & accountguid & "', '" & Request.Form("fld_firstname") & ")'"

Bob Lehmann

"Phil Kelly" wrote in message
news:u55W75dAGHA.3984@TK2MSFTNGP14.phx.gbl...
> Hi
>
> The following error is generated when I run the code underneath. I am
trying
> to write a guid from a session variable to a SQL table.
>
> I cant't see an 'unclosed quotation mark anywhere! Any ideas?
>
> Thanks!
>
> Phil
>
> ERROR:
> Microsoft OLE DB Provider for SQL Server error '80040e14'
> Unclosed quotation mark before the character string
> '{536696D8-3928-40C2-9088-05032E705077}'.
>
> CODE:
> accountguid = server.createobject ("scriptlet.typelib").guid
> <%Session("AccountGUID") = accountguid%>
> Account GUID = <% = Session("AccountGUID") %><%
> CreateAccount = "INSERT into tbl_test(fld_accountGUID, fld_firstname)
VALUES
> ('"&accountguid&"', '"& Request.Form("fld_firstname") &"')"
>
>
>

Re: 80040e14 Unclosed quotation mark

am 16.12.2005 12:45:51 von reb01501

Phil Kelly wrote:
> Hi
>
> The following error is generated when I run the code underneath. I am
> trying to write a guid from a session variable to a SQL table.
>
> I cant't see an 'unclosed quotation mark anywhere! Any ideas?
>
> Thanks!
>
> Phil
>
> ERROR:
> Microsoft OLE DB Provider for SQL Server error '80040e14'
> Unclosed quotation mark before the character string
> '{536696D8-3928-40C2-9088-05032E705077}'.
>
> CODE:
> accountguid = server.createobject ("scriptlet.typelib").guid
> <%Session("AccountGUID") = accountguid%>
> Account GUID = <% = Session("AccountGUID") %><%
> CreateAccount = "INSERT into tbl_test(fld_accountGUID, fld_firstname)
> VALUES ('"&accountguid&"', '"& Request.Form("fld_firstname") &"')"

Once again, problems resulting from the attempt to use dynamic sql.

I would be using a stored procedure for this (http://tinyurl.com/jyy0) but
if you have something against stored procedures, you can still use
parameters:

dim sql, arParms,cmd
'first verify that accountguid and Request.Form("fld_firstname")
'actually contain valid data, then:
arParms=Array(accountguid, Request.Form("fld_firstname") )
sql="INSERT into tbl_test(fld_accountGUID, fld_firstname) " & _
"VALUES (?,?)"
set cmd=createobject("adodb.command")
cmd.commandtext=sql
cmd.commandtype=1 'adCmdText
set cmd.activeconnection=
cmd.execute ,arParms,128 '128=adExecuteNoRecords

Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"