Author Topic: Any idea on how to access blob data type(DB) through QTP/VBScript  (Read 1757 times)

Offline Raj kumar

  • Newbie
  • *
  • Posts: 12
Any idea on how to access BLOB data type(DB) through QTP/VBScript?

If I use any normal SQL Query, I am getting error "Unspecified error"


Offline Tarun Lalwani

  • Administrator
  • Hero Member
  • *****
  • Posts: 2948
    • KnowledgeInbox
Re: Any idea on how to access blob data type(DB) through QTP/VBScript
« Reply #1 on: June 25, 2009, 07:50:03 PM »
Look at this and let me know if it does not help

http://williammeitzen.netfirms.com/clobread.html
Regards,
Tarun
KnowledgeInbox Administrator

KnowledgeInbox" style="border:0

Offline Raj kumar

  • Newbie
  • *
  • Posts: 12
Re: Any idea on how to access blob data type(DB) through QTP/VBScript
« Reply #2 on: June 28, 2009, 11:02:11 PM »
It worked fine after using oraOLEDB connection & writing the Blob value to a stream file instead of storing to a variable.

set oCon = CreateObject("ADODB.Connection")
Set oRs = CreateObject("ADODB.Recordset")
set mstream = CreateObject("ADODB.Stream")
mstream.Type = 1 'adTypeBinary
sql="select Data_Value from WLI_QS_REPORT_DATA where rownum=1"
vuid="*******"
vpwd="****"
pstr="Provider=OraOLEDB.Oracle; Data Source=QA2; User id="&vuid&"; Password=" &vpwd &";"

oCon.Open pstr
oRs.open sql,oCon

mstream.Open
mstream.Write oRs("Data_Value")
mstream.SaveToFile "c:\test.xml", 2 'adSaveCreateOveWrite , also tried
mstream.close

Thanks Tarun. Please close this thread.

Offline Tarun Lalwani

  • Administrator
  • Hero Member
  • *****
  • Posts: 2948
    • KnowledgeInbox
Re: Any idea on how to access blob data type(DB) through QTP/VBScript
« Reply #3 on: June 28, 2009, 11:03:29 PM »
Thats great :). Thread locked
Regards,
Tarun
KnowledgeInbox Administrator

KnowledgeInbox" style="border:0