Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using GetString to pull information from a DB
#1
Not Solved
Okay, I can use the ADO to connect to my databases and I can pull information - I only have read access for testing.

Anyway, when I pull back the specific item I was doing this for, I get extra characters - {}.
It does not appear in the DB with the braces on the outside when I SQL Server manager.

Let's assume the GUID I am looking for is in the correct location and shows: 123-234-456
Here is what I am using in QTP:

Code:
Dim sConnect, sDatabase, sRecord, sGUID, sURL, sSQL
Set sConnect=Createobject("ADODB.Connection") 'Connect
sDatabase="Driver={SQL Server};Server=testing.intgdb.testthis.com;DATABASE=MainQA;UID=jcc26;Password=******"
sConnect.open (sDatabase)
sSQL="Select Guid1 from dbo.pat inner join dbo.SurveyPat on dbo.pat.pat_id=dbo.SurveyPat.pat_ids where email = 'test9901@mailinator.com'"
Set sRecord = sConnect.Execute(sSQL)
sGUID = sRecord.GetString
sURL = "https://test.test.net/survey.aspx?sid="&sGUID
msgbox sURL 'for testing
So, I expect:

https://test.test.net/survey.aspx?sid=123-234-456
But I am getting:

https://test.test.net/survey.aspx?sid={123-234-456}

Anyone have any ideas why?
Reply
#2
Not Solved
Used mid() to accomplish this.
Reply
#3
Not Solved
What happens if you try retrieving the guid using the field name:

Code:
sGUID = sRecord.Fields("Guid1")
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  web edit pull down raphael 1 2,261 11-16-2009, 11:52 AM
Last Post: venkatbatchu

Forum Jump:


Users browsing this thread: 1 Guest(s)