Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using ado recordset and the getstring method

Status
Not open for further replies.

michaelcoleman

Programmer
Jun 26, 2003
21
US
Hello,

I'm having trouble getting the getstring method to work in vbscript over asp.

set oADOConnection = openDBConnection()

Set oADORecordset = oADOConnection.Execute(buildsql(report_type)) '''call function in sqlUtility.asp and get data

Response.Write(oADORecordset.GetString(adClipString,-1,",",chr(13)&chr(10),"(NULL)"))


---I know that there is data
---I know that it works in vb6
---I know that the rest of the asp code is correct

But it causes an error and nothing is displayed....


Can anyone offer insite?

One of my guesses is that the two are using different dll's, if that is true, how to specify which one in vbscript

MJC
 
is this a predefined function in your script. If it works in VB it really means nothing to vbscript. openDBConnection() is not a built in call which from memory is in VB right?

this should help though

____________________________________________________
[sub]The most important part of your thread is the subject line.
Make it clear and about the topic so we can find it later for reference. Please!! faq333-3811[/sub]
onpnt2.gif
 
Please assume that open db works but here is opendbconnection

function openDBConnection()
'This line creates an ADO Connection object
dim oADOConnection

On Error Resume Next

Set oADOConnection = Server.CreateObject("ADODB.Connection")

'We can then open a connection Database
oADOConnection.Open ("PROVIDER=MSDASQL;driver={SQL Server};server=fstpkop3140;uid=;pwd=;database=LMUTesterData;")

If Err.Number <> 0 Then
Response.Write &quot;Error Occurred Reading Records: &quot; & Err.Description
Set Session(&quot;oRpt&quot;) = nothing
Set Session(&quot;oApp&quot;) = nothing
Session.Abandon
Response.End
end if

'turn off the error handler
on error goto 0
set openDBConnection = oADOconnection
end function

the problem is with this string
oADORecordset.GetString(adClipString,-1,&quot;,&quot;,chr(13)&chr(10),&quot;(NULL)&quot;))

later down in the asp code, i send the data to crystal reports, so i know that there is data, it just seems there is a problem with this method call.

MJC
 
you got it dude...with the link

Response.Write(oADORecordset.GetString(,,&quot;,&quot;,chr(13)&chr(10),&quot;(NULL)&quot;))
works while
Response.Write(oADORecordset.GetStringad(ClipString, -1, &quot;,&quot;, &quot;,&quot;, &quot;(NULL)&quot;))

Thanks,

 
[smile]

____________________________________________________
[sub]The most important part of your thread is the subject line.
Make it clear and about the topic so we can find it later for reference. Please!! faq333-3811[/sub]
onpnt2.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top