Re: Writing a GUID to a SQL table



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 & "')"
>
>


.



Relevant Pages

  • Re: Using DirectShow to extract information from AVI WMV?
    ... > documentation, and found that besides video & audio dimensions, IMediaDet ... > can basically get a GUID identifier for the video and audio stream. ... includes a format block with the format details. ...
    (microsoft.public.win32.programmer.directx.video)
  • Re: bulk inserting uniqueidentifier column
    ... I use in bulk insert a format file like this: ... first record extends into the GUID in the second record, ... Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx ... Books Online for SQL Server 2005 at ...
    (comp.databases.ms-sqlserver)
  • Re: Downloadble Address Book not Syncronizing
    ... I suggest reset the system folder using the following ... Under GUID Format, select Registry Format. ... How to Reset System Folders on an Exchange 2000 Server ...
    (microsoft.public.exchange2000.admin)
  • Re: ADO & Sql Server, Error 80040e21
    ... Chances are you are not sending the GUID in the right format to the server. ... Please see the MSDN doc on this type at ... > Whenever we try to insert a record, which has a field type ...
    (microsoft.public.data.ado)
  • bulk inserting uniqueidentifier column
    ... I'm trying to bulk insert a uniqueidentifier column from unicode file. ... I use in bulk insert a format file like this: ... Why sql converts alphanumerical GUID into only numbers ID? ...
    (comp.databases.ms-sqlserver)

Loading