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

Recordset is 0 but should not be?

Status
Not open for further replies.

Phailak

Programmer
Apr 10, 2001
142
0
0
CA
Hail,

I tried to puzzle this out all morning, I usually use DAO but I know it's not very efficinet with SQL so I'm trying to use ADO now. Anyway, the recordset below is returning 0 records when I know that specific query returns records, I'm wondering if it has to do with something I'm doing? I'm connecting to a DB on an SQL 6.5 and I replaced UID and PWD

============================================================
Dim conn As New ADODB.Connection, rs As New ADODB.Recordset, sConnString As String
Dim Obj As Object
Dim X As Integer, Y As Integer, RecCount As Long

sConnString = "Provider=SQLOLEDB.1;User ID=AAA;password=AAA;Initial Catalog=CSB;Data Source = SRB2;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096"

conn.Open sConnString

rs.Open "SELECT * FROM moderator_tbl WHERE accnt_nmbr like '555-555-9034*' ORDER BY dt_added DESC", conn, adOpenStatic, adLockReadOnly

Do Until rs.EOF
A = rs!frst_nm & " " & rs!lst_nm
B = rs!mdrtr_id
C = rs!Title
D = rs!dt_added
E = rs!lst_updt_dt
F = rs!typ_bsnss
G = rs!notes
rs.MoveNext
Loop
 
use % instead of * in LIKE pattern.

------
[small]<this is sig>
select stuff(stuff(replicate('<P> <B> ', 14), 109, 0, '<.'), 112, 0, '/')
</this is sig>[/small]
[banghead]
 
LOL, that was so simple it hurts!

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top