recordset.open via JET 3.5 
Author Message
 recordset.open via JET 3.5

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



Sun, 22 Sep 2002 03:00:00 GMT  
 recordset.open via JET 3.5

If StudentID is a text field and iStudentID is an integer then change
your sql statement to this:

"Select AccountBalance from Students " & _
"Where StudentID = '" & Str(iStudentID) & "'"

else if you StudentID field is an integer then drop the Str() from the
sql statement.

As for SQL vs Access in the samples, I used Biblio as a substitute for
Pubs. Change the field refs and you should be ok.



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



Mon, 23 Sep 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. ADO rs.open via Jet 3.5

2. US/UK Date corruption: Jet 3.5 stored procs via Jet 4

3. URGENT: Convert Jet 2.0 to 3.5 via VB

4. Jet 3.0 vs Jet 3.5 table locking during queries

5. jet 3.5 vs jet 4.0

6. Jet 3.5 or Jet 4.0

7. Convert DAO 3.5 to DAO 3.6 Jet Engine 4.0

8. Visual Foxpro vs Jet 3.5 -- Comparison (Help!)

9. VFP vs Jet 3.5 Comparison (Help!)

10. Can you force access 2000 to use jet 3.5

11. Performance Problem with Jet 3.5 Engine

12. Jet 3.5 or 4.0?

 

 
Powered by phpBB® Forum Software