Re: Writing a GUID to a SQL table
- From: "McKirahan" <News@xxxxxxxxxxxxx>
- Date: Mon, 26 Dec 2005 21:31:44 -0600
"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 & "')"
.
- Follow-Ups:
- Re: Writing a GUID to a SQL table
- From: Phil Kelly
- Re: Writing a GUID to a SQL table
- References:
- Writing a GUID to a SQL table
- From: Phil Kelly
- Writing a GUID to a SQL table
- Prev by Date: Writing a GUID to a SQL table
- Next by Date: Re: Writing a GUID to a SQL table
- Previous by thread: Writing a GUID to a SQL table
- Next by thread: Re: Writing a GUID to a SQL table
- Index(es):
Relevant Pages
|
Loading