I am at present constructing a little program in Visual Basic 6 to extract some data from an Microsoft SQL server running our main database within the college and have run into a little problem that has me stumped.
I have been using an MS access database that represents the final target database (Table names, Field names etc are identical with test data) and have developed an SQL select statement that works fine from within VB code on this access database . But when I redirect the same SQL statement to the SQL server I get the following error.

Run-time error ‘40002’:
37000:[Microsoft][ODBC SQL server driver][SQL server]The cursor was not declared.

SQL Statement is as follows:

SELECT ST.STUD_Student_ID , ST.STUD_Surname_S02 , ST.STUD_Forname_1_S03, se.STEN_Student_ID, se.STEN_Prog_code FROM STUDstudent AS ST, STENenrols AS se, st INNER JOIN se ON st.stud_student_id=se.sten_student_id WHERE se.sten_expctd_end_date__q17 > #" & Date & "# and se.sten_actual_end_date__q18 IS null

Database Structure
Table STENenrols
STEN_Student_ID Key field
STEN_College_Year
STEN_Prog_Code
STEN_Type_Of_Record
STEN_Actual_End_Date__Q18
STEN_Expctd_End_Date__Q17
STEN_Completion_Stat_Q19

Table STUDstudent
STUD_Student_ID key field
STUD_College_Year
STUD_Surname_s02
STUD_Forename_1_s03
STUD_Primary_Programme

Is there some thing I have overlooked with regard to differences between ACCESS and MS SQL Server?