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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ADODB.RecordSet open fails

Status
Not open for further replies.

alonex

Programmer
Jan 10, 2006
14
US
Hi,

I'm having problems retrieving data from large SQL table (100,000+ users), some users can be found using "select" command in SQL analyzer but NOT in the VB script.
Any ideas?

Thanks,
Alonex

Excerpt of the Code:
==========================

SET rsUnAcknowledged = CreateObject("ADODB.RecordSet")
cnHeat.Open("Provider=SQLOLEDB; DATA SOURCE=127.0.0.1;UID=sa;PWD=123456; DATABASE=testDB")
SQLText = "Select * from users where userid=N'"&user_id.value&"'"

rsUnAcknowledged.Open SQLText, cnHeat, 0,1 'Cursor Type=0 (Forward Only)

uidSQL = 0

On Error Resume Next
uidSQL = cInt(rsUnAcknowledged("uid"))
===========================================
 
>SQLText = "Select * from users where userid=N'"&user_id.value&"'"
What is N? If it is by design values of userid are having the prefix N, then it should at least look like this.
[tt]SQLText = "Select * from users where userid='N"&user_id.value&"'"[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top