Unclosed quotation mark before the character string  
Author Message
Darlaston1





PostPosted: Tue Sep 16 06:13:37 CDT 2003 Top

SQL Server >> Unclosed quotation mark before the character string

Hi, i'm using ' guid = server.createobject("scriptlet.typelib").guid ' to
make a guid, but when im trying to store that string in a row in my SQL 2000
table i get the following error.

Microsoft OLE DB Provider for SQL Server (0x80040E14)
Unclosed quotation mark before the character string
'{E43061EB-47E3-4CC7-81DD-B4F37B2D597A}'.

I use
SQL = "Insert Into TBL_Test (u_GUID, u_Name ) Values('"&guid&"',
'"&Name&"')"
MyConn.Execute(SQL)

I have tried to remove the {} and - but the error is still there. But if i
take the string and manualy replace it with the "&Name&" then it will insert
ok. Why? I'm also tried to add a ' att the begining and end of the string,
but then the error is:
Microsoft OLE DB Provider for SQL Server (0x80040E14)
Unclosed quotation mark before the character string
''{E43061EB-47E3-4CC7-81DD-B4F37B2D597A}''.

/Per W.

SQL Server256  
 
 
Per





PostPosted: Tue Sep 16 06:13:37 CDT 2003 Top

SQL Server >> Unclosed quotation mark before the character string


> It looks like you have the guid in parenthesis... It should not be... so
> change the guid variable.

I have tried that. And it still dont work, but, if i use

rs.addnew
rs("u_GUID") = guid
etc..
etc..
rs.update

then it works, but i want to use the INSERT, but maybe that dosnt work.

/Per W.


 
 
Dipen





PostPosted: Tue Sep 16 14:20:33 CDT 2003 Top

SQL Server >> Unclosed quotation mark before the character string Use this code,

Function GetGuid()

Dim t
Dim guidraw

'Here we just get the left 37 characters, to
strip out the "},\,0" at the end.

Set t = Server.CreateObject("scriptlet.typelib")
guidraw = Left(t.guid,37)

'Now we take out the "{" at the beginning.
GetGuid = Right(guidraw,Len(guidraw)-1)

Set t = Nothing

End Function

>-----Original Message-----
>

melding

>> It looks like you have the guid in parenthesis... It
should not be... so
>> change the guid variable.
>
>I have tried that. And it still dont work, but, if i use
>
>rs.addnew
> rs("u_GUID") = guid
> etc..
> etc..
>rs.update
>
>then it works, but i want to use the INSERT, but maybe
that dosnt work.
>
>/Per W.
>
>
>.
>