ADO rs.open via Jet 3.5 
Author Message
 ADO rs.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  
 ADO rs.open via Jet 3.5
Try this

    rsAccountBalance.Open "Select AccountBalance from Students Where
StudentID = '" & Str(iStudentID) &"'", cnStateUBookstore, adOpenStatic,
adLockReadOnly, adCmdText



Sun, 22 Sep 2002 03:00:00 GMT  
 ADO rs.open via Jet 3.5

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



Sun, 22 Sep 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. recordset.open via JET 3.5

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

3. Bounding Datalist with Rs via Open or Rs via cmd.execute

4. URGENT: Convert Jet 2.0 to 3.5 via VB

5. Can VB6 do ADO into Jet 3.5?

6. Jet 3.0 vs Jet 3.5 table locking during queries

7. jet 3.5 vs jet 4.0

8. Jet 3.5 or Jet 4.0

9. Convert DAO 3.5 to DAO 3.6 Jet Engine 4.0

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

11. VFP vs Jet 3.5 Comparison (Help!)

12. Can you force access 2000 to use jet 3.5

 

 
Powered by phpBB® Forum Software