If the table field type is a string in Access, you should change your sql to
Select AccountBalance from Students Where
Quote:
> StudentID = '" & Str(iStudentID) & "'",
Yours would have said " studentid = 12334 ", this one will say
" studentid = '12334'
Nico
Quote:
> I am using the Mastering MS VB 6 Development course. I do not have SQL 6.5
> or 7.0 and am using a Access DB.
> However, while MS provides the .mdb file (which does not match the SQL
> DB!!>) they do not tell you how to accomplish the labs using Access instead
> of SQL. (how uncool)
> I need help with the following line:
> ' *** beginning of code sample
> 'open the recordset using argument for StudentID
> rsAccountBalance.Open "Select AccountBalance from Students Where
> StudentID = " & Str(iStudentID), , cnStateUBookstore, adOpenStatic,
> adLockReadOnly
> '*** end of code sample
> I get a "Type Mismatch" error at this point. The connection,
> cnStateUBookstore, has been set before this code and used to retrieve data
> successfully earlier in the program.
> Any help would be appreciated.
> Thank You,
> David