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
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