General discussion

Locked

Inserting GUID problem

By IamPud ·
I have a interesting issue.

I am trying to create an account using SQL in a asp page. All I want to do is insert a record using the username they give and a newid that is created using the following code:
Function getGUID()
Dim myTypeLib
Set myTypeLib = Server.CreateObject("Scriptlet.Typelib")
getGUID = myTypeLib.guid
End Function

strGUID = getGuid()

strSQL = "insert into users (Friendlyname, userguid) VALUES ('"
strSQL = strSQL + accountname
strSQL = strSQL + "', "
strSQL = strSQL + strGUID
strSQL = strSQL + ")"

Now the problem is the fact I CAN NOT get the ")" to be added. I have tried and tried but with no luck. It seems as soon as it add the GUID it will not add any after it. not even in a response.write

Any suggestions would be great.

This conversation is currently closed to new comments.

3 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Inserting GUID problem

by roc180 In reply to Inserting GUID problem

I believe the problem lies with using the + symbol instead of using the & symbol. The script is trying to perform a numeric calculation with the GUID. Use the following code for your strSQL:

strSQL = "insert into users (Friendlyname, userguid) VALUES ('"
strSQL = strSQL & accountname
strSQL = strSQL & "', "
strSQL = strSQL & strGUID
strSQL = strSQL & ")"

If that doesn't do it email me with your full ASP page and I can take a look at it.

Neal Martinelli

Collapse -

Inserting GUID problem

by IamPud In reply to Inserting GUID problem

Poster rated this answer

Collapse -

Inserting GUID problem

by IamPud In reply to Inserting GUID problem

This question was closed by the author

Back to Web Development Forum
3 total posts (Page 1 of 1)  

Related Discussions

Related Forums