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!

Recordset DTC and setSQLText

Status
Not open for further replies.

JuanitaC

Programmer
Feb 21, 2001
292
CA
Here is my situation: I have a recordset object that does not auto open on page load. I call the rs.open() method, and in the rs_onbeforeopen() method I set the sql for the recordset:

function window_onload(){
...
rs.open()
if(rs.isOpen(){
alert(rs.getCount())
}
}

function rs_onbeforeopen(){
var sql=""
sql="SELECT * from tblTable"
rs.setSQLText(sql)
alert(rs.getSQLText())
}

function rs_ondatasetcomplete(){
alert("here")
//do some stuff here
}

The sql statement that I use works fine in the query analyzer (SQL Server 2000), but the ondatasetcomplete function doesn't ever fire and the getCount after the open is called is always 0, even though the query should return 14 rows. The alert with the SQL text in it does display, so I know it goes to the onbeforeopen function. All other recordsets on the page work fine.

Does anyone have any ideas what could be going wrong with this? I have stared at it for the past couple of days with no luck.

Thanks.
 
Actually, I double checked the page, and the other recordsets are not working either. The page is using <meta name=&quot;VI60_DTCScriptingPlatform&quot; content=&quot;Client (IE 4.0 DHTML)&quot;>

Any clue as to why the recordsets are all coming up empty?
 
Try turning on the trace option (look at the top of the page, and set the trace to true). This may help!

You may prefer to set the SQL and recordset open in the thisPage_onenter event (have you added a PageObject DTC to your page - then add one now!)

Should you be using Server-Side code, or do you need to use Client side? I only do server side, as it is cross browser compatable. (Content Management)
 
Thanks, I switched everything to server-side and now it works fine. I am updating someone else's code, so I don't really know if the client side stuff ever really worked or not.

Anyway, thanks for the suggestions.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top