Re: Writing a GUID to a SQL table



Phil Kelly wrote:
>> What do you see when you do this:
>>
>> Response.Write vartype(accountguid)
>
>
> This returns an 8 character - a string value?
>
>> I'm thinking that you may need to explicitly cast accountguid as a
>> string before attempting to concatenate it into your dynamic sql
>> (ugh!) statement. Like this:
>> accountguid=cstr(accountguid)
>
> The problem remains the same when I attempt this!
>
>> My suspicion is that an error is occurring when attempting to do that
>> final concatenation, an error that is being masked by an "on error
>> resume next" statement, which explains why the ending quote and
>> closing parenthesis are missing from the result.
>
> No 'on error resume next' exists in this code. :(

I've just done some testing and realized you need to trim the final two
characters from the guid before attempting to use it, like this:

accountguid = left(accountguid,38)


--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


.