Re: Writing a GUID to a SQL table
- From: "Phil Kelly" <phil.kelly@xxxxxxxxxxxx>
- Date: Tue, 27 Dec 2005 09:11:34 -0000
Hi and thanks for your response!
The response.write displays a perfectly formed GUID, no more. (if I create a
guid using NEWID() and select records and response.write them to the screen
I get exactly the same format (the guid is obviously different though!) so I
know the formats are correct.
The error is something about an unterminated string before the GUID. I don't
have the error to hand at the moment.
I looked at your suggestion and can't actually see where it differes from
mine.
Phil
"McKirahan" <News@xxxxxxxxxxxxx> wrote in message
news:8ZidnVL3l_r1KC3enZ2dnUVZ_sidnZ2d@xxxxxxxxxxxxxx
> "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: Bob Barrows [MVP]
- Re: Writing a GUID to a SQL table
- References:
- Writing a GUID to a SQL table
- From: Phil Kelly
- Re: Writing a GUID to a SQL table
- From: McKirahan
- Writing a GUID to a SQL table
- Prev by Date: Re: Writing a GUID to a SQL table
- Next by Date: Regarding ASP.NET
- Previous by thread: Re: Writing a GUID to a SQL table
- Next by thread: Re: Writing a GUID to a SQL table
- Index(es):
Relevant Pages
|
Loading