Hi,
Here is the code.
Set con1 = CreateObject("adodb.connection")
Set rs3 = CreateObject("adodb.recordset")
con1.Open "Provider=sqloledb;Data Source=xxx;Initial Catalog=yyy; User Id=sa; Password=@1234;"
rs3.Open "select a.courseid,a.semester,a.period,c.Category,b.credit,a.gradecode,d.GradePoint from x a ,y b,z c,m d where a.rollno='" & pprollno & "' and a.semester<>'" & prsem & "' and a.period<>'" & pperiod & "' and a.categoryid=c.categoryid and a.courseid=b.courseid and a.gradecode=d.gradecode order by a.semester,a.period", con1
If Not (rs3.BOF And rs3.EOF) Then
Do While Not rs3.EOF
pcrseid = rs3("courseid")
psemester = rs3("semester")
vperiod = rs3("period")
mcategory = Trim(rs3("category"))
mcredit = rs3("credit")
mgrade = rs3("gradecode")
mgradepoint = rs3("gradepoint")
rs3.movenext
Loop
End If
'end
rs3.Close
Am getting wrong values from the record set. Am don't know.Why ?Please help me out.