Re: Writing a GUID to a SQL table



INSERT into tbl_accounts(fld_firstname, fld_surname, fld_address1,
fld_address2, fld_city, fld_county, fld_postcode, fld_country,
fld_accountGUID) VALUES ('Firstname', 'Surname', 'addr1', 'addr2', 'Bury',
'Lancashire', 'BB11BB', 'GB', '{1E0E9020-8025-4A11-8B8A-DF2F29882054}

Which I assume tells me that the INSERT statement is not correctly
terminated - but looking at the code it seems to be???



"McKirahan" <News@xxxxxxxxxxxxx> wrote in message
news:EdWdnR4ZRN2INCzeRVn-ig@xxxxxxxxxxxxxx
> "Phil Kelly" <phil.kelly@xxxxxxxxxxxx> wrote in message
> news:em#ToIyCGHA.2912@xxxxxxxxxxxxxxxxxxxxxxx
>> Hi Bob
>>
>> OK, this is the exact code that I am using:
>>
>> accountguid = server.createobject ("scriptlet.typelib").guid
>> response.write(accountguid)
>>
>> WriteToTable = "INSERT into tbl_users(fld_firstname, "&_
>> " fld_surname, "&_
>> " fld_address1, "&_
>> " fld_address2, "&_
>> " fld_city, "&_
>> " fld_county, "&_
>> " fld_postcode, "&_
>> " fld_country, "&_
>> " fld_accountGUID) "&_
>> " VALUES "&_
>> " ('"& Request.Form("fld_firstname") &"', "&_
>> " '"& Request.Form("fld_surname") &"', "&_
>> " '"& Request.Form("fld_address1") &"', "&_
>> " '"& Request.Form("fld_address2") &"', "&_
>> " '"& Request.Form("fld_city") &"', "&_
>> " '"& Request.Form("fld_county") &"', "&_
>> " '"& Request.Form("fld_postcode") &"', "&_
>> " '"& Request.Form("fld_country") &"', "&_
>> " '"&accountguid&"')"
>>
>> 'Set CreateAccountAction = Connect5.Execute(writeToTable)
>> response.write(Connect5.Execute(writeToTable))
>>
>> When I execute this code (to provide the response.write), I get the
>> following (which appears identical to the error I gave earlier, apart
>> from
>> the line number of the error):
>>
>> {DA0FCCBE-E3C2-42CA-8505-37080DD1D8D2}
>> Microsoft OLE DB Provider for SQL Server error '80040e14'
>>
>> Unclosed quotation mark before the character string
>> '{DA0FCCBE-E3C2-42CA-8505-37080DD1D8D2}'.
>>
>> /testapp/Step1CreateAccountWrite.asp, line 38
>>
>> Does it make sense now?
>>
> [snip]
>
> A Response.Write does not execute the SQL statement;
> it just displays the contents of the variable "WriteToTable".
>
> Please, just run it with these two lines after "WriteToTable =":
>
> Response.Write(WriteToTable)
> Response.End
>
> Post what is displayed.
>
>


.



Relevant Pages

  • Re: Writing a GUID to a SQL table
    ... > Hi Bob ... this is the exact code that I am using: ... > Microsoft OLE DB Provider for SQL Server error '80040e14' ... A Response.Write does not execute the SQL statement; ...
    (microsoft.public.inetserver.asp.db)
  • Re: Conditional "If Not ... Then" Statement not working properly H
    ... IF Not Bob = 42 Then Exit Sub ... (Condition will not execute because it is FALSE and the "IF" statement ... If Bob42 Then Exit Sub ... Returning to your IF statement, if the variables x, y and z are Boolean types, the simplest way to test if all 3 are TRUE is: ...
    (microsoft.public.excel.programming)
  • Re: Address Book for All Users Points to the Same wab file
    ... MAKE SURE THAT YOU DOWNLOAD THE VB FILE - DON'T EXECUTE IT! ... Then I opened the VB script using NotePad and set up my path the ... [Notice the two instances of Bob] ... >>> logging on into those accounts. ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: Conditional "If Not ... Then" Statement not working properly H
    ... be true in order for VBA to execute the code in the "IF" statement. ... TRUE that Bob is 42) ... IF Not Bob = 42 Then Exit Sub (Condition will not execute because it is ... Dim one As Boolean, two As Boolean, three As Boolean ...
    (microsoft.public.excel.programming)
  • Re: Error with insert into statement
    ... It tells ADO that you want it to execute a sql statment ... Bob Barrows ... Please reply to the newsgroup. ...
    (microsoft.public.inetserver.asp.general)

Loading