Re: Writing a GUID to a SQL table



"Phil Kelly" <phil.kelly@xxxxxxxxxxxx> wrote in message
news:OWUJ4RoCGHA.2704@xxxxxxxxxxxxxxxxxxxxxxx
> Hi and merry Christmas to everyone!
>
> I create a guid using the following code:
>
> accountguid = server.createobject ("scriptlet.typelib").guid
>
> and get it to response.write OK to the screen. However, when I try to
write
> the accountguid to a sql table using the following:
>
> writeToTable = "INSERT into tbl_users(fld_firstname, "&_
> " fld_surname,"&_
> "fld_userGUID) " &_
> " VALUES ('"& Request.Form("fld_firstname") & "', " &_
> " '"& Request.Form("fld_surname") & "', " &_
> " '"&accountguid&"' )"
>
> I receive an error. Can anyone tell me why?

Perhaps if you told us what the error was!

What does the response.write show?

Also, what database and version are you using.


http://www.w3schools.com/sql/sql_insert.asp

INSERT INTO table_name (column1, column2,...)
VALUES (value1, value2,....)

Perhaps:

writeToTable = "INSERT INTO tbl_users(
fld_firstname, fld_surname, fld_userGUID) VALUES ('" &
Request.Form("fld_firstname") & "', '" &
Request.Form("fld_surname") & "', '" &
accountguid & "')"


.



Relevant Pages

  • Thanks oodles, but I still cant get any image to show up in the stationery.
    ... have to be missing something somewhere. ... and Merry Christmas! ... Cindy ... Prev by Date: ...
    (microsoft.public.windows.inetexplorer.ie6_outlookexpress.stationery)
  • Re: What did we get for Christmas
    ... store airplane movies...plus Star Wars ep.III,original King Kong DVD ... and lotsa clothes. ... Merry Christmas everyone! ... Prev by Date: ...
    (rec.models.scale)
  • 24 Ms for M !!!!!!!!!!
    ... Thanksgiving and a very Merry Christmas. ... One more thing, Pray for our troops. ... Prev by Date: ...
    (alt.support.stop-smoking)
  • Re: ASC Christmas Carols :)
    ... >You forgot that trouble comes in that package, ... Merry Christmas, Karen. ... And thanks for the carols. ... Prev by Date: ...
    (alt.smokers.cigars)
  • Re: Spartan3e and ChipScope
    ... Too much danger of miscommunication. ... Merry Christmas to all. ... Peter Alfke ... Prev by Date: ...
    (comp.arch.fpga)

Loading