Database Access 
Author Message
 Database Access

I'm going nuts trying to set a Data Control to a Query Parameter. I have
tried code from VB4 help files, from VB Programmers Journal and from MS
KnowledgeBase Q142938. Nothing works. I am using VB4 Pro with Access 97
database with DAO 3.5 loaded. The following code works best:
Private Sub cmdAdd_Click()
    Dim db As Database
    Dim rs As Recordset
    Dim qd As QueryDef
    Dim prm As Parameter
    Set db = OpenDatabase(Data1.DatabaseName)
    Set qd = db.QueryDefs("newTitle")
    For Each prm In qd.Parameters
        prm.Value = InputBox("Enter value for " & prm.Name)
    Next prm
    Set rs = qd.OpenRecordset(qd, dbOpenDynaset)
    Set Data1.Recordset = rs ' ERROR HERE
End Sub
The error is type 13 'Type Mismatch'. Both rs and Data1.recordset are type
2 dynasets. rs is correctly set as an object.
Would really appreciate any help! Thanks.

Wed, 27 Oct 1999 03:00:00 GMT
 [ 1 post ] 

 Relevant Pages 

1. Databases, Access/SQL Server, and Internet Access

2. SQL Access Group and RDA(Remote Database Access)

3. Access database access

4. Multiple database access using Access

5. question reg. MS-Access database access using VB3

6. database client technology, seeing trough the microsoft fog of database access

7. Database access via activeX document to remotre database

8. Give a user database Access permit right to a database

9. Restricting Database Access from specific applications

10. Simple SQL database access with c++ code - bare bones....don't want to use wizard

11. C++ and Database Access

12. Exclusive database access when doing a restore

Powered by phpBB® Forum Software